views:

92

answers:

4

I'm working on a application where I have an imaging inspection process and a Ui process. Both are programming using c# 4.0. They may or may not be on the same machine. I have to design it to handle both methods. The inspection process will be essentially running as the server in this application on a windows 7/64 box.

In terms of communication, messages from Ui to inspection process will be minimal. Mostly start/stop/update configuration type messages. When the inspection process is inspecting, it can be streaming up to 10mb/sec of images for monitoring on a continuous basis.

In SO 468375, if both processes are on the same machine, then it is recommended to use Named Pipes. Sounds like a good solution.

However, my real question is - What is a current recommended best practice for communicating between these two processes if they are on different computers. A WCF Service, sockets, remoting, named pipes, etc?

+8  A: 

Remoting is deprecated. WCF encapsulates Remoting, Web Services, and other older communication technologies.

Edit - added this next one paragraph

WCF was introduced as a way to make using these underlying technologies more consistent. Coding a web service is pretty much the same as coding a Remoting service, etc. This isn't an exact comparison, but it's along the lines of what they were shooting for with LINQ as well. With LINQ you use a similar syntax whether accessing SQL data, objects, XML, etc.

End Edit

I would say use WCF services for what you're describing. it's what they were made for.

David Stratton
I agree. If it's on the machine, named pipes via WCF is a great option...
Reed Copsey
Sounds like WCF is way to go. One point of clarification - Can I run the WCF service as part of my inspection app.exe or does it have to be installed as a Windows Service?
photo_tom
It does not need to be part of a Windows service. The service can bohosted in a winforms, a consle app, or in IIS.
David Stratton
Please see the videos here for a gentle introduction and to get up and running quickly: http://msdn.microsoft.com/en-us/netframework/first-steps-with-wcf.aspx
David Stratton
+2  A: 

Extra info re David's answer.

Note that WCF can use different underlying bindings. Named Pipes on the local machine should be fastest (it uses memory mapped files in .Net 4.0). TCP to remote machine probably easiest and performant.

There's a discussion of the choice of transport here.

Steve Townsend
+1  A: 

If you have the resources I would suggest an MSMQ. We use them extensively and they are lightweight, fast, and incredibly easy to program for in .net.

Justin
Nice. I forgot about that.. But again. WCF encapsulates this as well. You can use WCF and choose teh MSMQ binding.
David Stratton