开发者_运维问答I have a large C#/WPF application. This application needs to collect data from other, "sub", applications that will be running on a Windows service - same network, different PC. Is sockets the best way to handle communications between the two (as opposed to remoting or something else)?
WCF is the recommended approach for cross process communication in v3.5 and newer. Sockets and Named Pipes could/would work, but you'll find much better support via WCF.
No way. Use WCF.
I would say that it ultimately depends on your performance requirements. Look at WCF as a layer of abstraction way above sockets. The price you pay for layering is performance, but I would be surprised if WCF did not offer sufficient performance for you.
Sockets is the fastest thing you can get, so if you need to make it as fast as you can you should use sockets. They're more complicated then WCF but in return you get full control on the lowest level.
Also be prepared that the actual bottleneck will be in Serialization/Deserialization of objects passed between client and server (of course if they're complicated).
精彩评论