SecurityMode.None leads to TimeoutException instead of CommunicationObjectFaultedException

混江龙づ霸主 提交于 2019-12-11 02:24:31

问题


I have a WCF self-hosted service with net.tcp binding. I need it to be nonsecured with reliable session.

When I configure it to nonsecure all calls to closed service (close, crash, process kill - any reason) lead to timeout exceptions (hang for a minute and timeout). When default (mode = Transport) - I get CommunicationObjectFaultedException at the same moment, seems like infrastructure automatically determines connection break.

How can I get immediate CommunicationObjectFaultedException with nonsecured settings?

Server and client configs are ok. Everything works fine untill I change to nonsecured (of course I change server and client configs). I've spent many hours to solve the problem, found some similar problems but no answer.

Server config:

<netTcpBinding>
<binding name="TCPBinding" receiveTimeout="Infinite">
  <reliableSession enabled="true" inactivityTimeout="00:10:00"/>
  <security mode="None">
  </security>
</binding>
</netTcpBinding>

来源:https://stackoverflow.com/questions/12097331/securitymode-none-leads-to-timeoutexception-instead-of-communicationobjectfaulte

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!