Skip to content

Commit

Permalink
feat: Updated H.Pipes.AccessControl to use official net5/net6 PipeSec…
Browse files Browse the repository at this point in the history
…urity implementation.
  • Loading branch information
HavenDV committed Sep 9, 2022
1 parent fffb4d2 commit 468aa10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
16 changes: 2 additions & 14 deletions src/libs/H.Pipes.AccessControl/H.Pipes.AccessControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,8 @@
<Description>This package adds AccessControl extensions for PipeServerSetPipeSecurity()</Description>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.8" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
<PackageReference Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.8" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.8" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.8" />
<ItemGroup>
<PackageReference Include="NamedPipeServerStream.NetFrameworkVersion" Version="1.1.10" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 0 additions & 6 deletions src/libs/H.Pipes.AccessControl/PipeServerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ public static void SetPipeSecurity<T>(this IPipeServer<T> server, PipeSecurity p
server = server ?? throw new ArgumentNullException(nameof(server));
pipeSecurity = pipeSecurity ?? throw new ArgumentNullException(nameof(pipeSecurity));

#if NET461_OR_GREATER
server.CreatePipeStreamFunc = pipeName => new NamedPipeServerStream(pipeName, PipeDirection.InOut, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous | PipeOptions.WriteThrough, 0, 0, pipeSecurity);
#elif NETSTANDARD2_0_OR_GREATER || NET5_0_OR_GREATER
server.CreatePipeStreamFunc = pipeName => NamedPipeServerStreamConstructors.New(pipeName, PipeDirection.InOut, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous | PipeOptions.WriteThrough, 0, 0, pipeSecurity);
#else
#error Target Framework is not supported
#endif
}

/// <summary>
Expand Down

0 comments on commit 468aa10

Please sign in to comment.