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.msmqnet.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 httpand 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.

WCF - net.pipe vs. net.tcp vs. http Bindings的更多相关文章

  1. WCF:如何将net.tcp协议寄宿到IIS

    1 部署IIS 1.1 安装WAS IIS原本是不支持非HTTP协议的服务,为了让IIS支持net.tcp,必须先安装WAS(Windows Process Activation Service),即 ...

  2. [转]WCF:如何将net.tcp协议寄宿到IIS

    本文转自:http://www.cnblogs.com/Gyoung/archive/2012/12/11/2812555.html 1 部署IIS 1.1 安装WAS IIS原本是不支持非HTTP协 ...

  3. wcf win7上使用net.tcp出现不支持协议问题解决

    第一:iis绑定 net.tcp 808:* 第二:iis 应用中高级开启协议,添加net.tcp多协议逗号隔开 第三:开启各项服务 第四:执行 ServiceModReg.exe -r

  4. 关于wcf配置未启动net.tcp监控导致无法访问wcf

    在服务里面启动NetTcpActivator和NetTcpPortSharing服务

  5. WCF入门教程1——WCF简要介绍

    什么是WCF Windows Communication Foundation(WCF)是由微软开发的一系列支持数据通信的应用程序框架,可以翻译为Windows 通讯开发平台. 整合了原有的windo ...

  6. WCF全面解析学习(1)

    SOA的基本概念和设计思想 SOA并不是仅仅采用Web服务的架构,Web服务只是一种实现SOA的理想技术手段.SOA依赖于开放的标准.SOA的一个目标是让不同的厂商开发的服务能够相互操作. SOA支持 ...

  7. 第三讲:WCF介绍(3)

    代码 https://yunpan.cn/cPns5DkGnRGNs   密码:3913   前面我们通过一个小的例子,大概了解的WCF. 这里我们补充下  EndPoint 配置  A,B,C  中 ...

  8. 地址(Address)——统一资源表示(URI)——WCF学习笔记(2)

    统一资源标识(URI) URI:Uniform Resource Identifier(统一资源标识),唯一地标识一个网络资源的同时也表示资源所处的位置的方式(资源访问所用的网络协议). URI结构: ...

  9. WCF简单教程

    WCF是DotNet体系中很重要的一项技术,但是组内很多组员通过书籍自学的时候 感觉涉及面太广.配置文件太复杂,新名词太多.抓不到头绪,有感于此,决定进行一次组内技术培训,顺便把培训讲义整理到blog ...

随机推荐

  1. Ajax实现页面后台button click事件无刷新弹窗

    很多人在做链接弹出新窗口的时候,都习惯用Response.Wrtite("<script>window.open('a.aspx')</script>") ...

  2. Spring Boot应用的健康监控

    在之前的系列文章中我们学习了如何进行Spring Boot应用的功能开发,以及如何写单元测试.集成测试等,然而,在实际的软件开发中需要做的不仅如此:还包括对应用程序的监控和管理. 正如飞行员不喜欢盲目 ...

  3. 转载:为什么Linux不需要磁盘碎片整理

    转载自:www.aqee.net 如果你是个Linux用户,你可能听说过不需要去对你的linux文件系统进行磁盘碎片整理.也许你注意到了,在Liunx安装发布包里没有磁盘碎片整理的工具.为什么会这样? ...

  4. TreeListView的用法

    public void ProductBind() { tlvProduct.Items.Clear(); List<ProductInfo> list = ppbll.GetProduc ...

  5. windows server 2003 取消登录Ctrl+Alt+delete

    安装Windows Server 2003操作系统的, 在console登录默认要先按下Ctrl+Alt+Delete组合键然后才弹出登录对话框 要取消这个限制的方法是: 点击 “开始-->运行 ...

  6. 10.29_Extjs-lovcombo

    (1) Ext.ux.form.LovCombo多选下拉框 :http://www.iteye.com/topic/340900 (2)combox:icon,lovcombo:icon (3) (4 ...

  7. 理解Http协议(一)

    本文对Http协议进行了简要的描述,说明了其用途的广泛性:通过代码对Http连接和Http请求消息的发送进行实现,希望能将这些抽象的过程直观的显示出来:最后对HttpURL和Http协议中“资源”这些 ...

  8. 微信分享功能引入页面-控制分享时候调用的标题、图片、url和微信按钮隐藏显示控制

    1.设置分享调用的标题.图片.url预览. 2.控制右上角三个点按钮的隐藏显示(和底部工具栏的显示隐藏--未测试). 3.判断网页是否在微信中被调用. <!doctype html> &l ...

  9. Javascript自执行匿名函数(function() { })()的原理浅析

    匿名函数就是没有函数名的函数.这篇文章主要介绍了Javascript自执行匿名函数(function() { })()的原理浅析的相关资料,需要的朋友可以参考下 函数是JavaScript中最灵活的一 ...

  10. http 和 Tcp 的区别

    http 和 tcp 的区别: Http在每一次请求结束后都会主动释放连接,因此HTTP连接是一种“短链接”,要保持客户端程序的在线状态,需要不断地向服务器端发起连接请求. TCP连接时一种“长连接” ...