views:

3088

answers:

4

I want communicate between a parent and child process both written in C#. It should be asynchronous, event driven. I does not want run a thread in every process that handle the very rare communication.

What is the best solution for it?

+6  A: 

Anonymous pipes.

http://msdn.microsoft.com/en-us/library/bb546102.aspx

Use Asynchronous operations with BeginRead/BeginWrite and AsyncCallback.

Carlos A. Ibarra
+6  A: 

I would suggest using the Windows Communication Foundation:

http://en.wikipedia.org/wiki/Windows_Communication_Foundation

You can pass objects back and forth, use a variety of different protocols. I would suggest using the binary tcp protocol.

bobwienholt
... so what's the complicated way then?
BPAndrew
@BPAndrew: Rewriting your own version of WCF? ;)
technophile
If WCF is the "simplest method", I really want to cry :P
kizzx2
+2  A: 

Named pipes on WCF.

http://msdn.microsoft.com/en-us/library/ms733769.aspx

David B
+3  A: 

This tutorial help you :
.NET 3.5 Adds Named Pipes Support
Interprocess Communication using Named Pipes in C#

lsalamon