![]() |
VOOZH | about |
dotnet add package H.Pipes.AccessControl --version 15.0.0
NuGet\Install-Package H.Pipes.AccessControl -Version 15.0.0
<PackageReference Include="H.Pipes.AccessControl" Version="15.0.0" />
<PackageVersion Include="H.Pipes.AccessControl" Version="15.0.0" />Directory.Packages.props
<PackageReference Include="H.Pipes.AccessControl" />Project file
paket add H.Pipes.AccessControl --version 15.0.0
#r "nuget: H.Pipes.AccessControl, 15.0.0"
#:package H.Pipes.AccessControl@15.0.0
#addin nuget:?package=H.Pipes.AccessControl&version=15.0.0Install as a Cake Addin
#tool nuget:?package=H.Pipes.AccessControl&version=15.0.0Install 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());
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();
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 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. 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 is compatible. 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 is compatible. 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 was computed. net462 net462 is compatible. 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 | 686 | 12/16/2024 |
| 15.0.0 | 25,702 | 12/6/2024 |
| 14.0.0 | 234,400 | 10/21/2024 |
| 2.2.2-dev.2 | 158 | 10/21/2024 |
| 2.2.1 | 1,460 | 10/19/2024 |
| 2.2.1-dev.2 | 174 | 10/19/2024 |
| 2.1.0-dev.322 | 831 | 1/20/2024 |
| 2.1.0-dev.318 | 234 | 12/18/2023 |
| 2.0.59 | 52,830 | 12/8/2023 |
| 2.0.56 | 1,013 | 11/27/2023 |
| 2.0.53 | 14,668 | 7/24/2023 |
| 2.0.51 | 5,725 | 5/25/2023 |
| 2.0.47 | 5,594 | 2/27/2023 |
| 2.0.46 | 437 | 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,626 | 9/14/2022 |
| 2.0.41 | 1,085 | 9/9/2022 |
| 2.0.40 | 632 | 8/26/2022 |
⭐ Last 10 features:
- feat: Updated to NET9 and added trimming/NativeAOT support. 2024-12-06
- feat: Use same versions for all packages. 2024-10-21
- feat: Added MessagePackFormatter<T1> to H.Formatters.MessagePack lib. 2024-01-20
- feat: Added PipeClient.CreatePipeStreamForConnectionFunc. 2023-12-08
- feat: Updated versioning. 2023-12-08
- feat: Added support for WriteOnly PipeServer. 2023-12-08
- feat: Added PipeServer.CreatePipeStreamForConnectionFunc. 2023-12-08
- feat: Use MessagePackFormatter by default on net8.0. 2023-11-27
- feat: Update to net8.0. 2023-11-27
- feat: Updated packages. 2023-07-24
🐞 Last 10 bug fixes:
- fix: Removed net6/net7. 2024-10-19
- fix: Small fixes for latest PR 2024-10-19
- fix: Updated System.Text.Json to 8.0.4 2024-09-17
- fix: Changed default formatter to SystemTextJsonFormatter. 2023-12-18
- fix: Fixed problems with $(BUILD_NUMBER). 2023-12-08
- test: Try to fix test for windows. 2023-12-08
- fix: Fixed bug with PipeStream.ReadAsync on non windows systems. 2023-05-26
- fix: Now EventExtensions is internal class. 2023-02-26
- fix: Fixed Connection.Disconnected unhandled exception bug. 2022-09-14
- fix: Fixed SemaphoreSlim usage. Fixes #24. 2022-08-26