WTDawson.EventPipes
1.2.1
Prefix Reserved
dotnet add package WTDawson.EventPipes --version 1.2.1
NuGet\Install-Package WTDawson.EventPipes -Version 1.2.1
<PackageReference Include="WTDawson.EventPipes" Version="1.2.1" />
<PackageVersion Include="WTDawson.EventPipes" Version="1.2.1" />
<PackageReference Include="WTDawson.EventPipes" />
paket add WTDawson.EventPipes --version 1.2.1
#r "nuget: WTDawson.EventPipes, 1.2.1"
#:package WTDawson.EventPipes@1.2.1
#addin nuget:?package=WTDawson.EventPipes&version=1.2.1
#tool nuget:?package=WTDawson.EventPipes&version=1.2.1
WTDawson.EventPipes
I made a blog post about WTDawson.EventPipes: View
WTDawson.EventPipes is a C# Class library designed to make a named pipe instance event based to make it easier for interprocess communication using named pipes.
Getting started
To get started, add the NuGet package to your project by either running the command below or if you are using visual studio follow these instructions:
- Right click your project or solution
- Find the button called something along the lines of "Manage NuGet Packages"
- Search for "WTDawson.EventPipes"
- Install it Or run this command:
dotnet add package WTDawson.EventPipes
Once WTDawson.EventPipes is added to your project or solution, create an instance of EventPipes
and call the Connect or ConnectAsync function to begin attempting to connect the pipes.
For example:
using WTDawson.EVentPipes;
namespace Testing {
internal class Program
{
static void Main(string[] args)
{
EventPipe eventPipe = new EventPipe("TestA", "TestB");
eventPipe.Connect();
}
}
}
Then, in another project, do the same thing but swap the primary and secondary pipe names around, for example:
using WTDawson.EVentPipes;
namespace Testing {
internal class Program
{
static void Main(string[] args)
{
EventPipe eventPipe = new EventPipe("TestB", "TestA");
eventPipe.Connect();
}
}
}
You can then easily create and send events between the two, for example on both sides you could do:
eventPipe.On("msg", (bytes[] data) => {
Console.WriteLine("Received " + Encoding.Default.GetString(data));
eventPipe.Send("msg", data);
});
eventPipe.Send("msg", Encoding.Default.GetBytes("Hello"))
You can also then listen on system events, for example:
eventPipe.Once("connected", () => {
Console.WriteLine("Pipe connected");
});
eventPipe.Once("disconnected", () => {
Console.WriteLine("Pipe disconnected");
});
Available system events: connected, disconnected.
| 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.