views:

6091

answers:

9

Should I use Named Pipes, or .NET Remoting to communicate with a running process on my machine?

A: 

.net remoting is built into .net to do inner process communication. If you use that, they will continue to support and possibly enhance it in future versions. Named pipes doesn't give you the promise of enhancements in future versions of .net

Kevin
Unlikely that they will enhance remoting. From someone on the remoting/WCF team: "there is very minimal development investment going into Remoting. WCF is the successor of Remoting." From here http://stackoverflow.com/questions/1294494/is-net-remoting-really-deprecated
MarkJ
+2  A: 

If you mean inter-process communication, I used .NET Remoting without any problem so far. If the two processes are on the same machine, the communication is quite fast.

Named Pipes are definitely more efficient, but they require the design of at least a basic application protocol, which might not be feasible. Remoting allows you to invoke remote methods with ease .

Dario Solera
WCF over named pipes allows this too. And you can just use the same contracts assembly in both processes.
Kent Boogaart
A: 

If it's on a single machine, Named Pipes gives you better performance and can be implemented with the remoting infrastructure as well as WCF. Or you can justdirectly use System.IO.Pipes.

Mark Cidade
A: 

.Net remoting isn't a protocol in and of itself. It lets you pick which protocal to use: SOAP, named-pipes, etc.

Joel Coehoorn
+19  A: 

WCF is the best choice. It supports a number of different transport mechanisms (including Named Pipes) and can be completely configuration driven. I would highly recommend that you take a look at WCF.

Here is a blog that does a WCF vs Remoting performance comparison.

A quote from the blog:

The WCF and .NET Remoting are really comparable in performance. The differences are so small (measuring client latency) that it does not matter which one is a bit faster. WCF though has much better server throughput than .NET Remoting. If I would start completely new project I would chose the WCF. Anyway the WCF does much more than Remoting and for all those features I love it.

MSDN Section for WCF

spoon16
Further evidence in favour of remoting. From someone on the Microsoft remoting/WCF team: "there is very minimal development investment going into Remoting. WCF is the successor of Remoting." From here http://stackoverflow.com/questions/1294494/is-net-remoting-really-deprecated
MarkJ
A: 

Do you mean "inter-process communication", i.e., communicating between two processes on the same machine, or communicating between different machines? The answer will vary depending on your answer.

A: 

Remoting in .NET Framework 2.0 provides the IPC channel for inter-process communication within the same machine.

icelava
+2  A: 

If you are using the .NET Framework 3.0 or above, I would use WCF. Using WCF, you can use different bindings depeneding on the trade-off between performance/interop/etc. that you need.

If performance isn't critical and you need interop with other Web Service technologies, you will want to use the WS-HTTP binding. For your case, you can use WCF with either a net-tcp binding, or a named-pipe binding. Either should work.

My personal take is that the WCF approach is more clean as you can do Contract-Driven services and focus on messages, not objects (I'm making a generalization here based on the default programming models of WCF/.NET Remoting). I don't like sending objects across the wire because a lot of semantic information gets lost or is not clear. When all you are doing is sending a message like you are with WCF, it becomes easier to separate your concerns between communication and the classes/infrastructure that a single node is composed of.

jolson
A: 

WCF also provides flexibility. By just changing some config (binding) you can have the same service on some other machine instead of IPC on same machine. Therefore your code remains flexible.

Vikram I Code