tags:

views:

275

answers:

4

anyone knows this problem, "The underlying connection was closed: An unexpected error occurred on a receive."? How can we resolve this problem?

A: 

yes, "the underlying connection was closed", or more precisely the browser was closed before the page loaded.

There's always the chance it's a real network level error (ie, bad proxy) but you don't provide enough detail.

SpliFF
A: 

I have increased shutdown time in the application pool and now it's work fine.

tiny
A: 

A Google search for "The underlying connection was closed: An unexpected error occurred on a receive." throws these results.

From there this post:

...I have added the following code to my reference.cs file (which needs to be done each time I update the webservice reference) to assign the keepalive value to false to allow the connection to be closed and reopened.

protected override WebRequest GetWebRequest(Uri uri)
        {
            HttpWebRequest webRequest = (HttpWebRequest) base.GetWebRequest(uri);

            webRequest.KeepAlive = false;
            webRequest.ProtocolVersion=HttpVersion.Version10;
            return webRequest;
        }


I have also added a reference to System.Net via a using statement to

import the HttpWebRequest namespace.

eKek0
A: 

This is a generic error that can be caused by just about anything (In my case some tiff images were causing gdi+ error in a wcf service).

Start by checking:

  1. IIS log files
  2. Application log files (ie. enable service logging if you use services)
  3. Permissions and security
Goran