简体   繁体   English

WCF中WSDualHttpBinding的优点是什么?

[英]What is the advantage of WSDualHttpBinding in WCF?

So far, no one can really offer any benefit of using dual channel over a client polling system except for the immediate notification you can get from the dual channel. 到目前为止,除了可以从双通道获得的即时通知之外,没有人能真正提供在客户端轮询系统上使用双通道的任何好处。 Every other point says if you dont need immediate notice the dual binding provides negative value - anyone disagree with this? 其他每一点都说如果你不需要立即通知双重约束提供负值 - 任何人都不同意这一点?

How much benefit would there be to using WSDualHttpBinding with IIS hosted service vs. a client poll that calls the WCF service, assuming in the latter the service cached the data in question? 使用IIS托管服务的WSDualHttpBinding与调用WCF服务的客户端轮询相比有多大的好处,假设在后者中服务缓存了有问题的数据?

This scenerio would be for a notify type of service where the clients need to be notified by the service when an event occurs. 此场景将用于通知类型的服务,其中客户端需要在事件发生时通知服务。

Specifically, what advantages would WSDualHttpBinding provide over polling? 具体来说,WSDualHttpBinding提供了哪些优于轮询的优势? ie: Less network traffic, faster to design, easier to maintain, more control ??? 即:网络流量更少,设计更快,更易于维护,更多控制???

From what i understand, WSDualHttpBinding is less scalable than client polling, so why use it at all? 据我所知,WSDualHttpBinding的可扩展性低于客户端轮询,所以为什么要使用它呢? Edit: As Matt supplied, time critical can be one reason for the duplex binding. 编辑:正如Matt提供的,时间关键可能是双面绑定的一个原因。

Here is what i have so far: 这是我到目前为止:

WSDualHttpBinding WSDualHttpBinding

adv: can get immediate response w/o waiting on polling timer adv:可以立即响应w / o等待轮询计时器

dis: less scalable than WsHttpBinding dis:比WsHttpBinding可伸缩性低

dis: less firewall friendly dis:防火墙友好

dis: slower than WSHttpBinding dis:比WSHttpBinding慢

I'll add to this based on comments, please let me know if i state anything incorrectly. 我会根据评论加上这个,如果我说错了,请告诉我。

thanks for you input :-) 谢谢你输入:-)

There is a wealth of information in this SO thread . 这个SO线程中有大量信息。 Basically, polling has the disadvantage that your client is only as up-to-date as its last poll, so for time-critical information you need to increase the frequency of polling. 基本上,轮询的缺点是您的客户端仅与其上次轮询一样是最新的,因此对于时间关键信息,您需要增加轮询的频率。 Each poll takes up network resources and creates overhead on the client. 每次轮询都会占用网络资源并在客户端上产生开销。 Solutions like long polling and WSDualHttpBinding are workarounds for that problem. 长轮询和WSDualHttpBinding等解决方案是解决该问题的方法。 WSDualHttpBinding has the disadvantage that the client must expose an endpoint to the server (which creates problems in firewalled environments). WSDualHttpBinding的缺点是客户端必须将端点暴露给服务器(这会在防火墙环境中产生问题)。 BOSH/XMPP or another form of long polling is another alternative. BOSH / XMPP或其他形式的长轮询是另一种选择。

WSDualHttpBinding was created for a reason. WSDualHttpBinding是出于某种原因而创建的。 WCF provided support for service 'callbacks' - methods on the client that were notified whenever service execution completed. WCF提供了对服务“回调”的支持 - 客户端在服务执行完成时收到通知的方法。 Unfortunately, HTTP - being a one way channel - would not allow for callbacks (by contrast, the TCPBinding allows it since TCP is a full duplex channel). 不幸的是,HTTP - 作为单向通道 - 不允许回调(相反,TCPBinding允许它,因为TCP是全双工通道)。 To get around HTTP's one-way nature, the DualHttpBinding was invented - two simultaneously open HTTP connections - one for the service request - and one for the callback. 为了解决HTTP的单向性问题,发明了DualHttpBinding--两个同时打开的HTTP连接 - 一个用于服务请求 - 一个用于回调。 It is not a question of scalability - but of need. 这不是可扩展性的问题 - 而是需求。 If you want to use callbacks (and callbacks are great especially if your service is going to be a time consuming (long running) service), WSDualHttpBinding may be your best option. 如果你想使用回调(并且回调很好,特别是如果你的服务将是一个耗时(长时间运行)服务),WSDualHttpBinding可能是你最好的选择。 Polling is possibly the worst for reasons already pointed out - each poll takes up network resources etc. 由于已经指出的原因,轮询可能是最糟糕的 - 每次轮询都会占用网络资源等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM