C#中的NetTcpBinding,WCF [英] NetTcpBinding in C# , WCF

查看:175
本文介绍了C#中的NetTcpBinding,WCF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我想提出与C#进行硬件通信的WCF(NetTcpBinding).与套接字通信相比是否可靠?我的消息可以和套接字通信一样快吗?请提出建议.这里有任何延迟吗?


问候,
Subrahmanyam Kota

Dear All,

I would like to propose the WCF (NetTcpBinding) for a hardware communication with a C#. Is it reliable when compared with socket communication. Can my messages go as fast as socket communication? Please suggest. Any latency maters here?


Regards,
Subrahmanyam Kota

推荐答案

NetTcp构建在TCP之上. TCP通常等效于套接字".

因此它的运行速度可与TCP一样快,但不会比TCP快.
速度实际上取决于您的问题的实质.

如果要创建硬件设备,并且要为其创建协议层,那么如果是我,我将使用TCP,而不是NetTCP.原因是它意味着潜在的市场更大.它并不会阻止您添加一个将其表示为NetTCP的库.进行相反的操作是可能的,但会更加奇怪.

我相当确定NetTcp会有消息开销.但是,仅当您的设备打算发送大量非常小的消息时,这才有影响.
NetTcp is built on top of TCP. Where TCP would normally be equivalent to a ''socket''.

So it can go as fast as but no faster than TCP.

Speed actually depends on what your question is really about.

If you are creating a hardware device and you want to create a protocol layer for it then if it was me I would use TCP, not NetTCP. The reason being that it means the market it potentially bigger. And it doesn''t stop you from adding a library that presents it as NetTCP. Doing the reverse is possible but would be much odder.

I am rather certain that there is a message overhead with NetTcp. This would only have an impact if your device is intended to send high volumes of very small messages however.


这篇关于C#中的NetTcpBinding,WCF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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