WCF - net.pipe vs. net.tcp vs. http Bindings
WCF - net.pipe vs. net.tcp vs. http Bindings
问题:
I'm new to WCF and would like to know the differences/advantages/limitations/etc of each of the following bindings:
net.pipe
net.tcp
http
Supporting scenarios on when to use each binding and other examples would be appreciated.
答案:
While not great for providing specific usage examples, here is a link from MSDN which lists all the features for the bindings.
http://msdn.microsoft.com/en-us/library/ms730879.aspx
Here is a decent flow chart that can help choosing between them as well.
Source: http://bloggingabout.net/blogs/dennis/archive/2006/12/01/WCF-Binding-decision-chart.aspx
Here is a good overall article I've used in the past.
http://mkdot.net/blogs/dejan/archive/2008/03/31/wcf-binding-decision.aspx (or here in the wayback machine if the link no longer works for you).
what's the difference between net.tcp and TCP protocol?
问题:
I am reading the < Learning WCF > by Michele Leroux Bustamante.
In this book, when it comes tonet.tcp protocol, the author just says TCP instead.
So what's the difference between net.tcp and the famous TCP protocol?
And as in net.msmq, net.pipe, what does the net prefix mean?
Many thanks.
回答:
net.tcp
is simply the URI scheme used within Windows to identify endpoints that can be accessed using TCP.
Similarly, net.msmq
and net.pipe
, are the URI schemes to address endpoints that utilise the MSMQ protocol and Named Pipes protocol, respectively.
The net
prefix on all three indicates that the URI scheme was devised solely for use on the Microsoft .NET platform and is not generally accepted in the wider internet. (Other URI schemes, such as http
and ftp
have have generally accepted meanings and are therefore utilised within WCF without any prefix). The net
prefix therefore serves as an warning bell that the associated endpoint will have limited/no interoperability with other applications that are not running on the .NET platform.
Example URIs:
net.tcp://localhost:7272
net.msmq://somemachine/publicQueue
net.pipe://machine.domain.com/somePipe
SIDEBAR: While MSMQ and Named Pipes are clearly Microsoft protocols and therefore a lack of interoperability is unsurprising, TCP is the foundation protocol of the internet and therefore, surely it's use in WCF should not be .NET specific?
Well, interoperability in WCF is already handled by SOAP and HTTP, which both run on top of TCP. If you want interoperability over TCP - use one of those protocols.
Microsoft was therefore looking to provide a communication alternative where performance, rather than interoperability, was the key objective. TCP was the logical choice, but TCP is a relatively low level protocol, which requires additional behavior and defaults to be implemented in order to work in a straight-forward manner for a messaging framework like WCF. In addition, there is no generally accepted URI scheme for TCP accessible resources and therefore Microsoft needed to invent one. Thus, net.tcp
was born.
While the URIs themselves don't necessarily indicate exactly which binding to use, they do provide a hint. As per Simon Mourier's answer, the bindings currently available within WCF can be found here. So, for instance, a net.tcp
address could indicate that NetTcpBinding, NetPeerTcpBinding, or NetTcpContextBinding is required.
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了