JontyMC
JontyMC

Reputation: 6068

WCF Client SocketException

We are getting an error on our production environment:

System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:10:00'. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

This happens on the first request after the WCF service has been idle for a time. Subsequent requests work correctly.

This error does not occur on our staging environment with the same configuration and data.

How do I go about diagnosing this? Tracing does not give any useful information.

Thanks, Jon

Upvotes: 0

Views: 2826

Answers (1)

Gregory A Beamer
Gregory A Beamer

Reputation: 17010

The first place to look is this: http://msdn.microsoft.com/en-us/library/bb332338.aspx

The issue you are describing sounds like IdleTimeout or ShutdownTimeout settings and having the domain recycle. Most likely, you have a long spin up time for the code to rejit when it spins down. Just a guess, but it would cover the symptoms.

One way to dupe this in another environment is setting up an instance and hitting it and then letting it sit idle for quite some time. If that yields nothing, get a delta between the environments. If you are doing more on the production environment that could be an issue when spin up happens.

Upvotes: 3

Related Questions