estanford
estanford

Reputation: 1312

Simple messaging options for .net programs

We have two thick-client .NET applications that need to send messages to each other on the same machine, and we're looking for ideas on how to make that happen. We thought about MSMQ and .NET remoting, but those both seem to be network-oriented technologies with more heavy machinery than we're interested in using at the moment. Command line arguments are out, because we want to send messages to running instances of the application. Does anyone happen to know a really simple way to send messages between apps on a single machine in .NET?

Upvotes: 4

Views: 163

Answers (2)

Jeremy McGee
Jeremy McGee

Reputation: 25200

Anonymous pipes are probably the best bet:

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

The link above shows a simple example. This will only work on the same machine, so there's no network gubbins or WCF configuration or whatnot to get in the way.

Upvotes: 4

Reed Copsey
Reed Copsey

Reputation: 564441

WCF is a very common means of handling this, now. On the same machine, you can set it up to use named pipes as a transport mechanism, which is very fast and fairly low overhead.

Depending on the messages, you can make one or both programs a WCF server, and then add a client reference into the other program to communicate.

Upvotes: 4

Related Questions