帮助选择绑定(WCF) [英] Help to choose a binding(WCF)

查看:157
本文介绍了帮助选择绑定(WCF)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建WCF应用程序,它会用图片来工作。它可以让你得到一个图片作为流,并发送图片到服务器(作为一个流)。它会在流传输模式。目前,我犹豫了这个最佳的选择。 basicHttpBinding的还是NetTcpBinding的?它们之间有什么区别?的优点和缺点。这将是这个问题比较好?

I need to create WCF Application, which will be working with pictures. It allows you to get a picture as a stream, and to send a picture to server (as a stream). It will work in streaming transfer mode. At the moment I hesitate over this choise. BasicHttpBinding or NetTcpBinding? What differences are between them? Advantages and disadvantages. Which will be better for this problem?

推荐答案

检查出的这个博客帖子(或许多其他类似的)

Check out this blog post (or many other, similar ones)

要选择合适的结合上图是从Juval洛伊的书编程WCF服务 并给出了最好的指导,真的:

The diagram to choose the proper binding is from Juval Lowy's book Programming WCF Services and gives the best guidance, really:

现在的流媒体的额外要求限制了选择的数量,很明显 - net.msmq是出了问题,显然

Now your additional requirement of streaming limits the number of choices, obviously - net.msmq is out of the question, obviously.

流由 basicHttpBinding的 NetTcpBinding的支持和 netNamedPipesBinding 。最后一个可能也是不可能的,因为它在同一台机器只(客户端和服务器)上运行。

Streaming is supported by basicHttpBinding, netTcpBinding, and netNamedPipesBinding. The last one probably also is out of the question, since it work on the same machine only (client and server).

所以,选择真正归结为 basicHttpBinding的 NetTcpBinding的。 basicHttp工作over HTTP连接和80端口,因此它非常适合互联​​网和向公众开放的方案,而netTcp可能有点快,但需要特定的端口,必须在服务器和/或防火墙上打开 - 因此它可能更适合于企业局域网环境中,而不是一般的互联网本身。

So the choice really boils down to basicHttpBinding vs. netTcpBinding. basicHttp works over http connections and port 80, so it's well suited for internet and "open to the public" scenarios, while netTcp might be a tad faster, but it requires specific ports, which need to be open on server and/or firewalls - so it's probably better suited for corporate LAN environments, but not for the general internet per se.

其他可能的绑定可考虑在非常特殊的情况,如:您可能要调查,如果你移动到云中的中继绑定,和联邦绑定如果你正在寻找进入联合安全性 - 但那些并不真正适用于此,当涉及到流

Other bindings might come into consideration in very specific scenarios, e.g. you might want to investigate the Relay bindings if you're moving into the cloud, and the Federation bindings if you're looking into federated security - but those don't really apply here when it comes to streaming.

这篇关于帮助选择绑定(WCF)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆