Search code examples
c#inter-process-communicat

Many-to-many interprocess communication, with no central hub


I'm looking for an efficient way to handle many-to-many communication between several processes running on my machine.

My requirements would be:

  • No central hub (e.g. no central process that routes the messages)
  • All the processes must be able to send a message
  • All the processes are notified when a new message (from any other process) is available

I would prefer a named pipes-based solution (with respect to, for example, a filesystem-based one).


Solution

  • You could try using Windows Communication Foundation (WCF) with the Peer to Peer binding (NetPeerTcpBinding). You could essentially create a decentralized message bus on it. It's TCP based, but that's pretty darn fast when it's on the same computer, so it is suitable for interprocess communication (although technically named pipes could achieve faster throughput and better latency, but only for extremely performance sensitive applications).

    Read "Peer-to-Peer Programming with WCF" for an introduction to the subject.