Blog Header Menu

Friday, February 15, 2013

WCF : System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host

WCF : System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host
Exception:  'System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host'



I  recently encountered WCF socketException and found that there could be majorly two reasons for this issue
  • Service Proxy was ideal for almost 10 minutes and after we can try to use the same service proxy.
  • Service is slowness, in this case, Service response time is crossed the default value of receiving timeout 
Considering the above two points, I made following changes in service config file, after that refreshed the client proxy with latest settings


1.       Increased the ReceivingTimeout   value to infinity

       <binding name="netTCPBinding"   receiveTimeout"infinite" >

2.       Increased the inactivityTimeout value to infinity in reliable session setting


<reliableSession inactivityTimeout="infinite" enabled="true" />

Thanks for visiting !!

3 comments:

  1. Hi I am facing a same problem but I am using webHttpBinding.and in webHttpBinding it dont have reliableSession filed so I can I achieve the same.

    ReplyDelete
  2. Ravi,

    Can you share binding configuration setting

    Regards,
    Rajeev

    ReplyDelete
  3. hello
    sir background change

    ReplyDelete