SimplePipe 1.1.2
dotnet add package SimplePipe --version 1.1.2
NuGet\Install-Package SimplePipe -Version 1.1.2
<PackageReference Include="SimplePipe" Version="1.1.2" />
<PackageVersion Include="SimplePipe" Version="1.1.2" />
<PackageReference Include="SimplePipe" />
paket add SimplePipe --version 1.1.2
#r "nuget: SimplePipe, 1.1.2"
#:package SimplePipe@1.1.2
#addin nuget:?package=SimplePipe&version=1.1.2
#tool nuget:?package=SimplePipe&version=1.1.2
SimplePipe
Simple Pipe is a small convenience wrapper for .NET's 'AnonymousPipeServerStream' and 'AnonymousPipeClientStream' classes. As it uses anonymous pipes, it can not do Network IPC and is intended for local use.
How to use
- Create an instance of the 'LocalServer' class.
- With that instance, you need to get hold of the pipe handles to instatiate the 'LocalClient' class, using the 'GetPipeHandles' method.
- Pass the pipe handles to the 'LocalClient' instance.
- Use the 'DisposeLocalCopyOfClientHandle' method in the instance of 'LocalServer' once the 'LocalClient' instance has created the pipes with the handles.
NOTE: Dispoing of the handles in the server is necessary for IPC. If you, for some reason, use server and client in the same program, you do not want to call 'DisposeLocalCopyOfClientHandle' on the server instance as it will throw an exception when you try to use sever and client. Disposing of the handles to early might cause problems, so you need to make sure you check if it safe to do so. A safe bet is to do so when the connection was established. As the server lives in another program, it is not possible to do it automatically
- Call 'Listen' method on each instances, or only one if you do not need to listen on both. Consider wrapping that call in a 'Task.Run(instance.Listen)' to make it run async.
- Call 'Write' method to write to the other side.
- Any messages received by either side will trigger a 'NewMessage' event on the respective side. In the server, the event data is a 'ClientMessage' instance, in the client it is a 'ServerMessage' instance.
V 1.1.0
Added the necessity to include a message type integer in the message. The first 6 characters of the message will be parsed as int. Their values can be found in the 'MessageType' property in the instances of 'ServerMessage' and 'ClientMessage'.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.