Sending messages between two C# programs...

S

Sunburned Surveyor

I'm very new to C# programming, but I have been writing programs in
Java for several years. I'm trying to find a simple way to send short
messages and data packages between two separate C# programs running on
the same computer.

I found a library on CodeGuru that allows this to be done using .NET
wrappers of Win32 named pipes. I also read that this can be done by
serializing and deserializing objects.

Is there a better way? I know I can use the serialization technique,
but it probably isn't the most elegant approach. I'm not sure if the
named pipes library is maintained anymore, and I don't know if it will
work on 64 bit Windows.

I appreciate any suggestions on how to handle this. Please note that I
do not need a solution that will allow communication over the internet
or a network. My two processes will always be running on the same
machine.

Thanks,

The Sunburned Surveyor
 
P

Peter Duniho

I'm very new to C# programming, but I have been writing programs in
Java for several years. I'm trying to find a simple way to send short
messages and data packages between two separate C# programs running on
the same computer. [...]

..NET supports "remoting", which is probably the easiest mechanism (I'm
told) if you only need to handle .NET applications talking to each other.

Outside of .NET, named pipes is a very common mechanism and I doubt it's
going away any time soon. It's been around forever, and Microsoft has had
plenty of chances to kill it off without doing so. Microsoft has a strong
history of maintaining backward compatibility and while there are
exceptions, I doubt named pipes will be one of them.

Other mechanisms that are well-known and commonly used are using sockets
(essentially network i/o) and shared memory mapped files. The latter
performs (slightly) better, but in some cases using a socket-based
paradigm is simpler. It kind of depends on what you want to do.

Pete
 
E

Eugene Mayevski

Hello!
You wrote on Thu, 28 Jun 2007 19:22:07 -0000:

SS> I appreciate any suggestions on how to handle this. Please note that I
SS> do not need a solution that will allow communication over the internet
SS> or a network. My two processes will always be running on the same
SS> machine.

Check MsgConnect ( http://www.msgconnect.com ). It does exactly what you
need.


With best regards,
Eugene Mayevski
http://www.SecureBlackbox.com - the comprehensive component suite for
network security
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top