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?
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?
Anonymous pipes.
http://msdn.microsoft.com/en-us/library/bb546102.aspx
Use Asynchronous operations with BeginRead/BeginWrite and AsyncCallback.
There's also MSMQ (Microsoft Message Queueing) which can operate across networks as well as on a local computer. Although there are better ways to communicate it's worth looking into: https://msdn.microsoft.com/en-us/library/ms711472(v=vs.85).aspx
There's also COM.
There are technicalities, but I'd say the advantage is that you'll be able to call methods that you can define.
MSDN offers C# COM interop tutorials. Please search because these links do change.
To get started rightaway go here...
If your processes in same computer, you can simply use stdio.
This is my usage, a web page screenshooter:
Detect args on Main
Named pipes on WCF.
http://msdn.microsoft.com/en-us/library/ms733769.aspx
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.