WCF与Socket的区别

WCF与Socket的区别,在低层实现上WCF是用Socket技术进行链接的,可以理解为WCF是Socket的一个超级封装版,帮你实现了好多的链接,传输,安全等方面的细节,从而让你专注于业务上的实践.

以下引用一段经验之谈:

With WCF you’ll get plumbing and serialization and such. 
The Protocol is already figured out for you: request/response message passing. 
The lowest level transport details are already implemented for you.

Socket code will require much more work and testing on your part, but can
potentially be faster.  You’ll have to create your own protocol, decide how
messages are serialized and so forth.  In my experience so far, I’ve used WCF or
REST APIs for everything except for a chat application I wrote, where it made
sense to go down to sockets.

Edit: one other reason why I used Sockets for the Chat application is that
while WCF has a "duplex" notion, sockets are naturally read/write, and it seemed
more natural.  If any event occurs on the server it can truly push a
message down to the client immediately using the socket and the client will read
this assuming the various async read code is set up. 

你可以到这里查看原文.