• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1541
  • Last Modified:

Which is fastest interprocess communication(WM_COPYDATA vs Winsock vs .NET Remoting)

Which is fastest interprocess communication and easy to implement (WM_COPYDATA vs Winsock vs .NET Remoting)
*I tried researching on Enterprise Services but there are very limited resources and samples to look at.

it will be implemented in the same machine(using Vista) as of now
but has a chance to transfer it to different machines in the future.
For Winsock, i think it is same as using TCPListener/tcpclient(correct me if i am wrong)
so maybe this is more easier and it is managed code
0
danace
Asked:
danace
  • 5
  • 5
1 Solution
 
drichardsCommented:
I'd look at named pipes if you are using  latest .NET (http://msdn.microsoft.com/en-us/library/system.io.pipes.aspx and http://msdn.microsoft.com/en-us/library/bb762927.aspx).  Faster than TCP on same machine and named pipes can also be used across machines.

If you use WCF you can configure which transport is used (HTTP, TCP, named pipes).
0
 
danaceAuthor Commented:
Thanks for the comment but when pipes is used across machines, the performance might suffer based on what i have read(http://msdn.microsoft.com/en-us/library/ms187892.aspx). That is why I didn't included pipes as my choice. As of now I am trying to find something that perfoms best either in the same or across machines.

I think implementing WCF may take time in implementing because i need to study it from scratch..
is there other recommendations?
0
 
drichardsCommented:
Since I don't know anything about your app, I cannot recommend what would be best.  I can only say that pipes are much better between local processes, which is your first target.  They are also not bad on a decent network with reasonable data volumes.  They are not best for high-volume server apps.

WCF, while it does have a learning curve, is also very powerful if your app needs the flexibility.

Otherwise, TCP is a solid choice and reasonably straightforward to implement.
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
drichardsCommented:
Even the MS article you refernce concedes that:

"Generally, TCP/IP is preferred in a slow LAN, WAN, or dial-up network, whereas named pipes can be a better choice when network speed is not the issue, as it offers more functionality, ease of use, and configuration options."

That does not sound like a compelling argument to avoid pipes just because a network is involved.

But again, you know the requirements of your app and I do not.  I just now I have used pipes quite successfully.  I have also used TCP and even UDP quite successfully, and the right choice does depend on the exact nature of the application.
0
 
danaceAuthor Commented:
I am developing a multithreaded client-server application(running Vista) which communicates via HTTP Request using HTTPListener/HTTPWebRequest. The server(which is the focus of my question) will be having different modules. I want these modules to communicate with each other using the fastest IPC but I can't figure out which of them are best in terms of speed. These modules reside in the same machine and be in different machines in the future.

I am really confused between those IPC mechanisms, and don't know which would be the best for me to use. Is named pipes still your recommendation for my application? How about remoting?
0
 
drichardsCommented:
I think you're probably needlessly confused.  You can probably use any of:

1) Named Pipes
2) TCP
3) TCP remoting
4) WCF configured for named pipes within the machine and TCP for remote operation

with success.  I'd start with the one you are most confortable with and check performance.  Remotring and WCF are only options if you are communicating via .NET objects.  If you've got some custom protocol that you want or need to use then you've got to do that yourself over a pipe or socket.
0
 
danaceAuthor Commented:
Thanks for the help, i will try to check out on these named pipes first.
But still not so satisfied with the solution though..I also found out about the Named pipe version .Net Remoting using Channel.Ipc...have any idea on it?
0
 
drichardsCommented:
Remoting Channel.IPC works as well.  If you're going to do remoting, though, I think it's worth learning WCF.  Might as well go with the most current thing in that case.

What else do you think you are looking for?  If you want the fastest commuincation, pipes are best on-box and TCP is probably best off-box, esppecially since that's what the remoting supports.  Remote pipes must be done using base IO.Pipes.

TCP is a decent compromise if you don't want the extra step of configuring the remoting.

We've got an app that uses TCP/binary remoting both on and off box and we haven't had performance issues to make us change.  It's to attach a web server to some back-end services running as Windows services.
0
 
danaceAuthor Commented:
Ok thank you for the suggestion regarding WCF.I may consider it.

Overall, thanks for the answers. It is very well explained.
0
 
danaceAuthor Commented:
Very Nice! Thanks for the help!
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now