All Projects → cyanfish → grpc-dotnet-namedpipes

cyanfish / grpc-dotnet-namedpipes

Licence: Apache-2.0 license
Windows named pipe transport for gRPC in C#/.NET

Programming Languages

C#
18002 projects

GrpcDotNetNamedPipes

NuGet

Windows named pipe transport for gRPC in C#/.NET.

This is not an official Google product.

Supported platforms

  • .NET Framework 4.6+ (Windows)
  • .NET Core 2.1+ (Windows)

Usage

Suppose you have a Greeter service as described in the gRPC on .NET Core intro.

Server:

var server = new NamedPipeServer("MY_PIPE_NAME");
Greeter.BindService(server.ServiceBinder, new GreeterService());
server.Start();

Client:

var channel = new NamedPipeChannel(".", "MY_PIPE_NAME");
var client = new Greeter.GreeterClient(channel);

var response = await client.SayHelloAsync(
	new HelloRequest { Name = "World" });

Console.WriteLine(response.Message);

Why named pipes?

Named pipes are suitable for inter-process communication (IPC).

Compared with gRPC over HTTP (using grpc or grpc-dotnet), you get:

  • Better access controls (e.g. current user only)
  • Lightweight pure .NET library (instead of 3MB+ native DLL or ASP.NET Core dependency)
  • Much faster startup time
  • 2x-3x faster large message throughput
  • No firewall warnings
  • No network adapter required

Caveats

This implementation currently uses a custom wire protocol so it won't be compatible with other gRPC named pipe implementations.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].