在WCF net.tcp绑定上更改套接字选项
我有一个使用net.tcp绑定并实现某些服务的.net 4.0 WCF应用程序。
我想为该绑定设置一个TCP套接字选项( ReuseAddress
选项。一个相关问题解释了为什么要这样做)。
如果我使用的是原始套接字,则可以使用 Socket.SetSocketOption 方法。
I have a .net 4.0 WCF application that uses the net.tcp binding and implements some service.
I would like to set a TCP socket option for that binding (ReuseAddress
option. A related question explains why I want to do that).
If I was working with Raw Sockets I could use the Socket.SetSocketOption Method.
是否可以通过某种方式从net.tcp绑定中提取底层的原始套接字以更改其选项?还是设置该选项的其他方法?
Is there a way to somehow extract the underlying Raw Socket from the net.tcp binding in order to change its options? Or some other way to set this option?
阿米尔,谢谢您提出添加ReuseAddress选项的建议。但是,我们需要更好地了解您的具体情况。在相关的问题中(在WCF net.tcp绑定上更改套接字选项)上下文,是否启用端口共享?似乎移植共享可能会导致类似的症状。基本上,我们需要具体的repro程序和设置步骤来更好地理解问题。
如果仍然有人遇到问题或需要添加复用地址选项,请在 http带有repro程序和repro步骤的://connect.microsoft.com/VisualStudio 。谢谢。
Amir, Thank you for your suggestion of adding ReuseAddress option. However, we need understand better what was your concrete scenario. In the related question (Changing Socket Options on WCF net.tcp binding) context, have you enable port sharing? Seems like porting sharing could result with similar symptom. Basically, we need concrete repro program and setup steps to understand better of the problem. If anyone still runs into the problem or see the need of adding reuseAddress option, please report the bug at http://connect.microsoft.com/VisualStudio with repro program and repro steps. Thank you.