同一台计算机 WCF 消息交换 => TCP?
Same computer WCF messages exchanges => TCP?
我的计算机上有一些程序和 WCF 服务 运行。我目前让他们使用 net.tcp 绑定进行通信(ipv4:127.0.0.01,ipv6:::1)。
这样的选择对吗?或者我只是错过了另一个更好的(更少的协议开销?)选项?
如果您 运行 服务和客户端在同一台计算机上,网络是最佳选择(在此处阅读更多信息:https://msdn.microsoft.com/en-us/library/system.servicemodel.nettcpbinding.aspx , but you can also consider net.pipes (read more here about the recomendations from each binding: https://msdn.microsoft.com/en-us/library/ms730879.aspx)
NetNamedPipeBinding
A secure, reliable, optimized binding that is suitable for on-machine
communication between WCF applications.
这个 link 也有一个使用 Tcp 和 Pipe 绑定的有趣基准测试:http://www.netfxharmonics.com/2006/01/WCF-Relative-Binding-Speeds
结果很有趣:
NetTcpBinding: Processed 39957 calls in 10 seconds
NetNamedPipeBinding: Processed 48255 calls in 10 seconds
希望对您有所帮助。
我的计算机上有一些程序和 WCF 服务 运行。我目前让他们使用 net.tcp 绑定进行通信(ipv4:127.0.0.01,ipv6:::1)。
这样的选择对吗?或者我只是错过了另一个更好的(更少的协议开销?)选项?
如果您 运行 服务和客户端在同一台计算机上,网络是最佳选择(在此处阅读更多信息:https://msdn.microsoft.com/en-us/library/system.servicemodel.nettcpbinding.aspx , but you can also consider net.pipes (read more here about the recomendations from each binding: https://msdn.microsoft.com/en-us/library/ms730879.aspx)
NetNamedPipeBinding
A secure, reliable, optimized binding that is suitable for on-machine communication between WCF applications.
这个 link 也有一个使用 Tcp 和 Pipe 绑定的有趣基准测试:http://www.netfxharmonics.com/2006/01/WCF-Relative-Binding-Speeds 结果很有趣:
NetTcpBinding: Processed 39957 calls in 10 seconds NetNamedPipeBinding: Processed 48255 calls in 10 seconds
希望对您有所帮助。