![]() |
VOOZH | about |
dotnet add package H.Pipes.AccessControl --version 2.0.40
NuGet\Install-Package H.Pipes.AccessControl -Version 2.0.40
<PackageReference Include="H.Pipes.AccessControl" Version="2.0.40" />
<PackageVersion Include="H.Pipes.AccessControl" Version="2.0.40" />Directory.Packages.props
<PackageReference Include="H.Pipes.AccessControl" />Project file
paket add H.Pipes.AccessControl --version 2.0.40
#r "nuget: H.Pipes.AccessControl, 2.0.40"
#:package H.Pipes.AccessControl@2.0.40
#addin nuget:?package=H.Pipes.AccessControl&version=2.0.40Install as a Cake Addin
#tool nuget:?package=H.Pipes.AccessControl&version=2.0.40Install as a Cake Tool
👁 Language
👁 Requirements
👁 Build Status
A simple, easy to use, strongly-typed, async wrapper around .NET named pipes.
client.WriteAsync, if necessaryPipeAccessRule's(see H.Pipes.AccessControl nuget package) or more complex code to access using the PipeServer.PipeStreamInitializeAction property👁 NuGet
👁 NuGet
👁 NuGet
👁 NuGet
👁 NuGet
// All clients and servers that do not need support AccessControl.
Install-Package H.Pipes
// Servers that need support AccessControl.
Install-Package H.Pipes.AccessControl
// If you want to transfer any data that can be serialized/deserialized in json using Newtonsoft.Json.
Install-Package H.Formatters.Newtonsoft.Json
// If you want to transfer any data that can be serialized/deserialized in json using System.Text.Json.
Install-Package H.Formatters.System.Text.Json
// If you want to transfer any data that can be serialized/deserialized in binary using Ceras.
Install-Package H.Formatters.Ceras
Server:
await using var server = new PipeServer<MyMessage>(pipeName);
server.ClientConnected += async (o, args) =>
{
Console.WriteLine($"Client {args.Connection.PipeName} is now connected!");
await args.Connection.WriteAsync(new MyMessage
{
Text = "Welcome!"
});
};
server.ClientDisconnected += (o, args) =>
{
Console.WriteLine($"Client {args.Connection.PipeName} disconnected");
};
server.MessageReceived += (sender, args) =>
{
Console.WriteLine($"Client {args.Connection.PipeName} says: {args.Message}");
};
server.ExceptionOccurred += (o, args) => OnExceptionOccurred(args.Exception);
await server.StartAsync();
await Task.Delay(Timeout.InfiniteTimeSpan);
Client:
await using var client = new PipeClient<MyMessage>(pipeName);
client.MessageReceived += (o, args) => Console.WriteLine("MessageReceived: " + args.Message);
client.Disconnected += (o, args) => Console.WriteLine("Disconnected from server");
client.Connected += (o, args) => Console.WriteLine("Connected to server");
client.ExceptionOccurred += (o, args) => OnExceptionOccurred(args.Exception);
await client.ConnectAsync();
await client.WriteAsync(new MyMessage
{
Text = "Hello!",
});
await Task.Delay(Timeout.InfiniteTimeSpan);
Notes:
Dispose before closing the program/after the end of use.
Pipes are system resources and you might have problems restarting the server if you don't properly clean up the resources.Since BinaryFormatter is used by default, you should check out this article: https://docs.microsoft.com/en-us/dotnet/standard/serialization/binaryformatter-security-guide
Install-Package H.Formatters.Newtonsoft.Json
Install-Package H.Formatters.System.Text.Json
Install-Package H.Formatters.Ceras
using H.Formatters;
await using var server = new PipeServer<MyMessage>(pipeName, formatter: new NewtonsoftJsonFormatter());
await using var client = new PipeClient<MyMessage>(pipeName, formatter: new NewtonsoftJsonFormatter());
⚠️ Note: this is only available for the Windows platform
Install-Package H.Pipes.AccessControl
using System.IO.Pipes;
using H.Pipes.AccessControl;
await using var server = new PipeServer<string>(pipeName);
// You can set PipeSecurity
var pipeSecurity = new PipeSecurity();
pipeSecurity.AddAccessRule(new PipeAccessRule(new SecurityIdentifier(WellKnownSidType.BuiltinUsersSid, null), PipeAccessRights.ReadWrite, AccessControlType.Allow));
server.SetPipeSecurity(pipeSecurity);
// or just add AccessRule's (Please be careful, the server will only consider AccessRules from the last call AddAccessRules())
server.AddAccessRules(new PipeAccessRule(new SecurityIdentifier(WellKnownSidType.BuiltinUsersSid, null), PipeAccessRights.ReadWrite, AccessControlType.Allow));
// or just
server.AllowUsersReadWrite();
⚠️ Note: this is only available for the Windows platform
Install-Package H.Formatters.Inferno
using H.Formatters;
await using var server = new PipeServer<MyMessage>(pipeName, formatter: new SystemTextJsonFormatter());
server.EnableEncryption();
await using var client = new PipeClient<MyMessage>(pipeName, formatter: new SystemTextJsonFormatter());
client.EnableEncryption();
await client.ConnectAsync(source.Token).ConfigureAwait(false);
// Waits for key exchange.
await client.Connection!.WaitExchangeAsync();
server.ClientConnected += async (_, args) =>
{
// Waits for key exchange.
await args.Connection.WaitExchangeAsync();
await args.Connection.WriteAsync(new MyMessage
{
Text = "Welcome!"
}, source.Token).ConfigureAwait(false);
};
server.ClientConnected += async (o, args) =>
{
var name = args.Connection.GetImpersonationUserName();
Console.WriteLine($"Client {name} is now connected!");
};
I recommend that you take a look at my other library if you plan on doing IPC. This is a SourceGenerator that will generate client and server code based on the presented interface.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 is compatible. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 is compatible. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on H.Pipes.AccessControl:
| Package | Downloads |
|---|---|
|
H.Formatters.Inferno
This package adds InfernoFormatter(based on Inferno). It allows encrypt your messages. |
|
|
H.Services.IpcService
Package Description |
|
|
H.Ipc.Generator
C# Source Generator for Inter-Process Communication. |
|
|
H.VpnService
C# high-level VPN library with implemented IPC |
|
|
H.Ipc
Core library for Inter-Process Communication. |
Showing the top 1 popular GitHub repositories that depend on H.Pipes.AccessControl:
| Repository | Stars |
|---|---|
|
ad2017gd/RainbowTaskbar
Powerful, customizable Windows 10/11 taskbar effects.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 15.0.1-dev.3 | 693 | 12/16/2024 |
| 15.0.0 | 26,593 | 12/6/2024 |
| 14.0.0 | 240,316 | 10/21/2024 |
| 2.2.2-dev.2 | 160 | 10/21/2024 |
| 2.2.1 | 1,498 | 10/19/2024 |
| 2.2.1-dev.2 | 176 | 10/19/2024 |
| 2.1.0-dev.322 | 833 | 1/20/2024 |
| 2.1.0-dev.318 | 236 | 12/18/2023 |
| 2.0.59 | 52,936 | 12/8/2023 |
| 2.0.56 | 1,015 | 11/27/2023 |
| 2.0.53 | 14,707 | 7/24/2023 |
| 2.0.51 | 5,729 | 5/25/2023 |
| 2.0.47 | 5,594 | 2/27/2023 |
| 2.0.46 | 438 | 2/26/2023 |
| 2.0.45 | 4,667 | 2/2/2023 |
| 2.0.44 | 6,633 | 1/10/2023 |
| 2.0.43 | 869 | 1/5/2023 |
| 2.0.42 | 7,637 | 9/14/2022 |
| 2.0.41 | 1,085 | 9/9/2022 |
| 2.0.40 | 633 | 8/26/2022 |
⭐ Last 10 features:
- feat: Added BinaryFormatter.InternalFormatter as public property. 2022-03-18
- feat(AccessControl): Enabled PipeApplication.StartAsync for non-windows system without AllowUsersReadWrite. 2022-03-12
- feat(Inferno): Added net5/net6 targets. Added SupportedOSPlatform attributes. 2022-03-12
- feat(Inferno): Added EnableEncryption optional exception action. 2022-03-12
- feat(AccessControl): Added SupportedOSPlatform attribute to SetPipeSecurity. 2022-03-11
- feat(AccessControl): Added explicit net5.0 and net6.0 target frameworks. 2022-03-11
- feat: Excluded WaitForPipeDrain call for non-windows platforms. 2022-03-11
- feat: Added SystemTextJsonFormatter.Options property. 2022-03-06
- feat: Added connection close if EnableEncryption fails. 2021-12-21
- feat: Added WaitExchangeAsync use example. 2021-12-20
🐞 Last 10 bug fixes:
- fix: Fixed SemaphoreSlim usage. Fixes #24. 2022-08-26
- fix: Fixes #24. 2022-08-26
- fix: Added IOException ignoring for FlushAsync/WaitForPipeDrain. 2022-06-02
- fix: Fixed missing PipeStreamReader read check. Refactored. 2022-04-21
- fix(AccessControl): Fixed NET461 library to use Net Framework NamedPipeServerStream ctor. 2022-03-11
- fix: Fixed ValidatePublicKey. 2022-03-07
- fix: Fixed PipeClient.Connection set access. 2021-12-21
- fix: Fixed problem with multiple server encrypted connections. 2021-12-20
- fix: Fixed EnableEncryption client/server settings. 2021-12-20
- fix: Fixed Inferno KeyPair missing disposing. 2021-12-20