Communication using Named Pipes (.NET)

Jawadhasan
4 min readOct 24, 2022

Introduction

Named Pipes are a mechanism for instant messaging between processes.

Following diagram shows a simple communication setup using Named Pipes:

  • The Server open a named pipe.
  • A client can listen to that pipe.
  • The client will receive message in real-time, the server send to the pipe.
  • The client must know the name of the pipe to connect to it.
  • Pipes are Byte-stream oriented.

A pipe is only useable for two processes. If you’ve a server and multiple clients, you’ll need different pipes for each client-server connection.

They also support full duplex communication and data transfer between local processes and between different machines on a network (Anonymous pipes are limited to processes which are running on the same PC). They also support client impersonation, which enables connecting processes to use their own set of permissions on remote servers.

Demo 1

A service send message via a named pipe to a client (console application) which writes…

--

--

Jawadhasan

Software Solutions Team Lead | Cloud Architect | Solutions Architect