8000 GitHub - klapeto/Solinosis: Simple duplex .NET Standard Inter Process Communication with Named Pipes
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

klapeto/Solinosis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Solinosis (Σωλήνωσης)

Solinosis (from Σωλήνωσης, Greek for 'Pipe') aims to be a simple Inter Process Communication library to provide a duplex comunication between processes written in .NET Standard or .NET Core. Under development.

Server Usage

As it is supposed to be used from .NET Standard or .NET Core projects, it can be used with Dependency Injection. Eg.:

public class TestService: ITestService
{
   public string TestCall(string arg)
   {
      Console.WriteLine($"TestCall called: {arg}");
      return $"TestCall received: {arg}";
   }
}

private static void Main(string[] args)
{
   var servicesCollection = new ServiceCollection();
   servicesCollection.AddNamedPipeServer("KKlapeto")
      .AddService<ITestService, TestService>()
      .AddCallback<ITestCallbackService>();

   var serverHost = new NamedPipeServerHost(servicesCollection.BuildServiceProvider());
   serverHost.Start();
   var reps = serverHost.GetCallbackProxy<ITestCallbackService>().TestCallback("Hello");
   Console.Read();
}

Client Usage

Similar to Server the client can be initialised:

public class Callback : ITestCallbackService
{
    public string TestCallback(string arg)
    {
        Console.WriteLine($"Callback: {arg}");
        return $"Callback: {arg}";
    }
}

private static void Main(string[] args)
{
    var servicesCollection = new ServiceCollection();
    servicesCollection.AddNamedPipeClient("KKlapeto")
        .AddService<ITestService>()
        .AddCallbackService<ITestCallbackService>(provider => new Callback());

    var client = new NamedPipeClient(servicesCollection.BuildServiceProvider());
    client.Connect();
    var res = client.GetServiceProxy<ITestService>().TestCall("Hahaha");
    Console.Read();
}

License

MIT

About

Simple duplex .NET Standard Inter Process Communication with Named Pipes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0