Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exchange data between two process? [duplicate]

Possible Duplicate:
IPC Mechanisms in C# - Usage and Best Practices

I have two diffenent process: A and B.

The process A wants to send to the process B some data (array of bytes, strings, structures, etc...). So suppose A need to send the following buffer:

var buffer = new byte[100].
SendToAnotherProcess(B, buffer);

And B need to receive this buffer:

byte[] buffer;
ReceiveFromAnotherProcess(A, out buffer);

What is the easiest solution to do this?

like image 669
Nick Avatar asked Nov 30 '12 10:11

Nick


2 Answers

You can use Named Pipe. If it is C# 4.0 and above, you can also use Memory mapped file

like image 197
Tilak Avatar answered Oct 22 '22 15:10

Tilak


There's a multitude of options. To name a few low-level IPC mechanisms:

  • named pipes
  • shared memory
  • TCP/IP sockets

Also, there are some higher-level options:

  • .NET Remoting
  • WCF
like image 2
Ondrej Tucny Avatar answered Oct 22 '22 15:10

Ondrej Tucny