Carubbi.Communication 1.2.2

Implementation of named pipes stream to abstract the complexity. Allow you to use interprocess communication in a simple way.

Install-Package Carubbi.Communication -Version 1.2.2
dotnet add package Carubbi.Communication --version 1.2.2
<PackageReference Include="Carubbi.Communication" Version="1.2.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Carubbi.Communication --version 1.2.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Carubbi.Communication

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

1. Server sample:

Echo Service:

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...");
    }
}

Server App:

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

2. Client Sample

Service Callback:

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");
   }
}

Client App:

using (var client = new Client<string, string>("EchoService"))
{
    client.BeforeConnect += (sender, eventArgs) => Console.WriteLine("Connecting...");
    client.AfterEnd += (sender, eventArgs) => Console.WriteLine("Disconected.");
    client.Subscribe(new EchoServiceCallback());
    client.Connect();
   
    Console.WriteLine("Type your message:");
    var message = Console.ReadLine();
    client.SendRequest(new List<string> { message });
} 

Carubbi.Communication

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

1. Server sample:

Echo Service:

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...");
    }
}

Server App:

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

2. Client Sample

Service Callback:

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");
   }
}

Client App:

using (var client = new Client<string, string>("EchoService"))
{
    client.BeforeConnect += (sender, eventArgs) => Console.WriteLine("Connecting...");
    client.AfterEnd += (sender, eventArgs) => Console.WriteLine("Disconected.");
    client.Subscribe(new EchoServiceCallback());
    client.Connect();
   
    Console.WriteLine("Type your message:");
    var message = Console.ReadLine();
    client.SendRequest(new List<string> { message });
} 

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.2.2 197 9/7/2018
1.2.1 159 9/5/2018
1.2.0 167 9/5/2018
1.1.4 157 9/5/2018
1.1.3 163 9/5/2018
1.1.2 142 9/5/2018
1.1.1 142 9/5/2018
1.1.0 147 9/4/2018
1.0.0 174 8/21/2018