Last post Aug 11, 2014 10:48 PM by Shawn - MSFT
Aug 11, 2014 04:31 AM|shouvicic|LINK
I am hosting single website in 2 servers and the load balancer is managing the requests. The sticky session is already being handled on a load balancer level.
At this point do we need to make any changes in the code for it to work?
We are getting an error once in a while "Http Exception: The underlying connection was closed. An unexpected error occurred on a receive."
We rarely get this error, not sure what scenario forces the error to pop.
Aug 11, 2014 10:48 PM|Shawn - MSFT|LINK
"Http Exception: The underlying connection was closed. An unexpected error occurred on a receive."
In some cases the first call to the webservice works just fine, but if in the following few minutes no new call to the webservice is made, the next call would throw the exception shown above. This problem could be solved by altering the generated proxy class;
in the GetWebRequest function the KeepAlive property must be set to false. This can be accomplished by following these steps:
protected override System.Net.WebRequest GetWebRequest(Uri uri)
System.Net.HttpWebRequest webRequest =
webRequest.KeepAlive = false;
For more information, you could also refer to: