Carubbi.Communication 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Carubbi.Communication --version 2.0.0
                    
NuGet\Install-Package Carubbi.Communication -Version 2.0.0
                    
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="Carubbi.Communication" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Carubbi.Communication" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Carubbi.Communication" />
                    
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 Carubbi.Communication --version 2.0.0
                    
#r "nuget: Carubbi.Communication, 2.0.0"
                    
#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 Carubbi.Communication@2.0.0
                    
#: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=Carubbi.Communication&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Carubbi.Communication&version=2.0.0
                    
Install as a Cake Tool

Carubbi.Communication

NuGet NuGet Downloads

Implementation of named pipes stream to abstract the complexity. Allows you to use inter-process communication in a simple way.

Projects

Project Package
Carubbi.Communication Carubbi.Communication

Target framework: net10.0 (Windows). Requires .NET 10 SDK.

Usage

Server

Create a service class that inherits from Server<TRequestMessage, TResponseMessage> and implements ProcessRequest and BeforeStart:

using Carubbi.Communication.NamedPipe;

public class EchoService : Server<string, string>
{
    public EchoService() : base(nameof(EchoService))
    {
    }

    protected override string ProcessRequest(string requestMessage)
    {
        Console.WriteLine($"Message received: {requestMessage}");
        return $"Message sent: {requestMessage}";
    }

    protected override void BeforeStart()
    {
        Console.WriteLine("Server starting...");
    }
}

Start the service in your server app:

var service = new EchoService();
service.Start();

Client

Implement an IObserver<TResponseMessage> to receive the responses:

public class EchoServiceCallback : IObserver<string>
{
    public void OnNext(string value) => Console.WriteLine(value);
    public void OnError(Exception error) => Console.WriteLine(error.Message);
    public void OnCompleted() => Console.WriteLine("Request Completed");
}

Send requests from your client app:

using Carubbi.Communication.NamedPipe;

using (var client = new Client<string, string>("EchoService"))
{
    client.BeforeConnect += (sender, eventArgs) => Console.WriteLine("Connecting...");
    client.AfterEnd += (sender, eventArgs) => Console.WriteLine("Disconnected.");
    client.Subscribe(new EchoServiceCallback());
    client.Connect();

    Console.WriteLine("Type your message:");
    var message = Console.ReadLine();
    client.SendRequest(new List<string> { message });
}

The pipe names default to {processName}_SERVER_PIPE (server to client) and {processName}_CALLBACK_PIPE (client to server). Both the server and the client must use the same processName, or pass explicit serverPipeName/callbackPipeName values.

Samples

Run the server and the client samples to see a fully working round-trip:

dotnet run --project samples/Carubbi.Communications.ServerSample -c Release
dotnet run --project samples/Carubbi.Communication.ClientSample -c Release

Building and testing locally

Prerequisites: .NET SDK 10.

dotnet build Carubbi.Communication.slnx -c Release
dotnet run --project tests/Carubbi.Communication.Tests/Carubbi.Communication.Tests.csproj -c Release

Releasing

Pushing a tag v* (for example v2.0.0) triggers the publish workflow, which builds in Release mode, packs the library and publishes it to nuget.org using GitHub Actions trusted publishing.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

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
2.1.0 109 9/3/2026
2.0.0 97 9/3/2026
1.2.2 1,368 9/7/2018
1.2.1 1,078 9/5/2018
1.2.0 1,091 9/5/2018
1.1.4 1,096 9/5/2018
1.1.3 1,067 9/5/2018
1.1.2 1,080 9/5/2018
1.1.1 1,042 9/5/2018
1.1.0 1,075 9/4/2018
1.0.0 1,116 8/21/2018