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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WTDawson.EventPipes" Version="1.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WTDawson.EventPipes" Version="1.2.1" />
                    
Directory.Packages.props
<PackageReference Include="WTDawson.EventPipes" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WTDawson.EventPipes --version 1.2.1
                    
#r "nuget: WTDawson.EventPipes, 1.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WTDawson.EventPipes@1.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WTDawson.EventPipes&version=1.2.1
                    
Install as a Cake Addin
#tool nuget:?package=WTDawson.EventPipes&version=1.2.1
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last Updated
1.2.1 179 12/23/2024
1.2.0 169 12/23/2024
1.1.0 169 12/23/2024
1.0.0 171 12/22/2024