From 468aa10a02c1cbc6035e2f7c23e44720ae6a0424 Mon Sep 17 00:00:00 2001 From: Konstantin S <3002068+HavenDV@users.noreply.github.com> Date: Fri, 9 Sep 2022 19:50:10 +1000 Subject: [PATCH] feat: Updated H.Pipes.AccessControl to use official net5/net6 PipeSecurity implementation. --- .../H.Pipes.AccessControl.csproj | 16 ++-------------- .../PipeServerExtensions.cs | 6 ------ 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/libs/H.Pipes.AccessControl/H.Pipes.AccessControl.csproj b/src/libs/H.Pipes.AccessControl/H.Pipes.AccessControl.csproj index 6c65b2f..b20610b 100644 --- a/src/libs/H.Pipes.AccessControl/H.Pipes.AccessControl.csproj +++ b/src/libs/H.Pipes.AccessControl/H.Pipes.AccessControl.csproj @@ -9,20 +9,8 @@ This package adds AccessControl extensions for PipeServerSetPipeSecurity() - - - - - - - - - - - - - - + + diff --git a/src/libs/H.Pipes.AccessControl/PipeServerExtensions.cs b/src/libs/H.Pipes.AccessControl/PipeServerExtensions.cs index 36cd69f..3e995b1 100644 --- a/src/libs/H.Pipes.AccessControl/PipeServerExtensions.cs +++ b/src/libs/H.Pipes.AccessControl/PipeServerExtensions.cs @@ -28,13 +28,7 @@ public static void SetPipeSecurity(this IPipeServer 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 } ///