GithubHelp home page GithubHelp logo

hengwh / grpc-dotnet-namedpipes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cyanfish/grpc-dotnet-namedpipes

0.0 0.0 0.0 174 KB

Named pipe transport for gRPC in C#/.NET

License: Apache License 2.0

C# 100.00%

grpc-dotnet-namedpipes's Introduction

GrpcDotNetNamedPipes

NuGet

Named pipe transport for gRPC in C#/.NET.

This is not an official Google product.

Supported platforms

  • .NET Framework 4.6.2+ (Windows)
  • .NET 6+ (Windows, macOS, Linux)

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).

Since the introduction of this project, ASP.NET Core has added support for gRPC over Unix Domain Sockets and over Named Pipes. Here is a handy matrix to help you decide what's right for you:

GrpcDotNetNamedPipes ASP.NET UDS ASP.NET Named Pipes ASP.NET HTTP
.NET Platform .NET Framework 4.6.2
.NET 5
.NET 5 .NET 8 (server)
.NET 5 (client)
.NET 5
OS Windows 7
Mac
Linux
Windows 10
Mac
Linux
Windows 7 Windows 7
Mac
Linux
No firewall warnings ✔️ ✔️ ✔️
No network adapter ✔️ ✔️ ✔️
Access controls ✔️ ✔️
Binary size (trimmed) ~ 300 KB ~ 7 MB ~ 7 MB ~ 7 MB
Startup time < 25ms < 25ms < 25ms ~ 250ms
Large message throughput ~ 500MB/s ~ 400MB/s ~ 100MB/s ~ 100MB/s
Streaming messages ~ 400k/s ~ 500k/s ~ 500k/s ~ 400k/s
Method calls ~ 8000/s ~ 4000/s ~ 5000/s ~ 2500/s
Compatible with gRPC-Go ✔️ ✔️ ✔️
Official Microsoft support ✔️ ✔️ ✔️

Performance numbers are based on tests running on Windows 11 with .NET 8.

Caveats

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

Linux and macOS support is provided for universal compatibility but may not be as optimized as Windows.

grpc-dotnet-namedpipes's People

Contributors

cyanfish avatar ccruden-shookiot avatar damienfarrar avatar taori avatar keboo avatar lab02-admin avatar nevermorewd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.