TLDR
TLDR

Reputation: 1278

When should I use Pipes or gRPC for interprocess communication (in C# .NET Core)?

Both Pipes and ASP.NET Core gRPC support local and remote IPC/RPC (with some platform limitations for gRPC)

When would I use one technology (Pipes) or the other (gRPC)?

Observations, thoughts and considerations I'm keeping in mind:

Right now my scenario is to have two console apps communicate with each other, same machine or remote. Adding Asp.NET Core Web is an optional front end alternative for my scenario.

Upvotes: 8

Views: 11561

Answers (1)

Ashutosh Raghuwanshi
Ashutosh Raghuwanshi

Reputation: 440

Simple IPC

Depends on how much communication is going to happen. If your communication is limited to simple collaborative signal passing or sharing some data between two processes you can safely use NamedPipeClientStream and NamedPipeServerStream on local system or local network but if you plan for the same on different systems then I would suggest using TcpClient and TcpListener.

Comprehensive IPC

WCF or now its replacement gRPC is for scenario where a complete API/Framework need to be executed remotely. For example I have an entire library of classes which I need to call from a different process (which mostly run on a different system); in that case gRPC kind of solutions make more sense.

Only you can decide.

This is a design decision which is highly unique for your application; your future plans and your system environment and any third person can only give you clues but ultimately you are the only person who can make the right decision.

Upvotes: 4

Related Questions