SecurityMode.None leads to TimeoutException instea

2019-07-10 03:05发布

问题:

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>