简体   繁体   English

WCF与二进制TCP

[英]WCF with Binary over TCP

WCF Binary over TCP option, is it applicable only for Intranet or Internet also? WCF二进制over TCP选项,是否仅适用于Intranet或Internet?

Is TCP applicable only for Intranet? TCP是否仅适用于Intranet?

The serializer and the transport are largely unrelated. 串行器和传输在很大程度上是不相关的。 There are pre-configured bindings for common scenarios, but my understanding is that you can plug the binary serializer ( NetDataContractSerializer ) into any transport. 有针对常见场景的预配置绑定,但我的理解是您可以将二进制序列化器( NetDataContractSerializer )插入任何传输。 Or write your own ;-p 或者写自己的;-p

However - a different transport may be trickier to configure (firewalls etc) than plain HTTP. 但是 - 与普通HTTP相比,配置(防火墙等)的传输可能比较复杂。

See here (although I would dispute the speed claim; I've seen NetDataContractSerializer thrashed on occasion...) 看到这里 (虽然我会反对的速度要求,我已经看到了NetDataContractSerializer 惨败之际...)


Re comment - not so much the transport (I suspect you're best off staying with http), but consider this and this . 评论 - 而不是运输 (我怀疑你最好留在http),但考虑到 一点 An alternative binary serializer , excellent for sending some types of messages. 另一种二进制序列化器 ,非常适合发送某些类型的消息。 And it plays nicely with MTOM (over http) too. 它也可以很好地与MTOM(通过http)配合使用。

The answer is: it depends. 答案是:这取决于。 As far as I know, WCF's binary encoding requires both endpoints to be WCF endpoints (which would currently limit you to Windows unless/until Mono supports binary encoding). 据我所知,WCF的二进制编码要求两个端点都是WCF端点(除非/直到Mono支持二进制编码,否则目前将限制为Windows)。 The other issue would be whether or not you can reach the port on which the remote server is listening. 另一个问题是您是否可以访问远程服务器正在侦听的端口。 One of the reason running services over HTTP has become so popular is that port 80 is much more like to be open. 通过HTTP运行服务的一个原因已经变得如此受欢迎,因为端口80更像是开放的。

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

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