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:

ravi said...

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.

Rajeev Tiwari said...

Ravi,

Can you share binding configuration setting

Regards,
Rajeev

Anonymous said...

hello
sir background change

SQL Server - Identify unused indexes

 In this blog, we learn about the index usage information (SYS.DM_DB_INDEX_USAGE_STATS) and analyze the index usage data (USER_SEEKS, USER_S...