The remote host closed the connection. The error code is 0x800704CD

an error occurred while communicating with the remote host. the error code is 0x800703e3
the remote host closed the connection csgo
remote host' error
an error occurred while communicating with the remote host the error code is 0x80070001
host closed the connection surviv io
0x800703e3 iis
error 0x80072746 azure vpn
failed to send http response error 800704cd

I receive error emails from my website whenever an exception occurs. I am getting this error:

The remote host closed the connection. The error code is 0x800704CD

and don't know why. I get about 30 a day. I can't reproduce the error either so can't track down the issue.

Website is ASP.NET 2 running on IIS7.

Stack trace:

at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect) at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush() at System.Web.HttpResponse.Flush(Boolean finalFlush) at System.Web.HttpResponse.Flush() at System.Web.HttpResponse.End() at System.Web.UI.HttpResponseWrapper.System.Web.UI.IHttpResponse.End() at System.Web.UI.PageRequestManager.OnPageError(Object sender, EventArgs e) at System.Web.UI.TemplateControl.OnError(EventArgs e) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.default_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I get this one all the time. It means that the user started to download a file, and then it either failed, or they cancelled it.

To reproduce the exception try do this yourself - however I'm unaware of any ways to prevent it (except for handling this specific exception only).

You need to decide what the best way forward is depending on your app.

The remote host closed the connection. The error code is , I get this one all the time. It means that the user started to download a file, and then it either failed, or they cancelled it. To reproduce the  Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more The remote host closed the connection.

As m.edmondson mentioned, "The remote host closed the connection." occurs when a user or browser cancels something, or the network connection drops etc. It doesn't necessarily have to be a file download however, just any request for any resource that results in a response to the client. Basically the error means that the response could not be sent because the server can no longer talk to the client(browser).

There are a number of steps that you can take in order to stop it happening. If you are manually sending something in the response with a Response.Write, Response.Flush, returning data from a web servivce/page method or something similar, then you should consider checking Response.IsClientConnected before sending the response. Also, if the response is likely to take a long time or a lot of server-side processing is required, you should check this periodically until the response.end if called. See the following for details on this property:

http://msdn.microsoft.com/en-us/library/system.web.httpresponse.isclientconnected.aspx

Alternatively, which I believe is most likely in your case, the error is being caused by something inside the framework. The following link may by of use:

http://blog.whitesites.com/fixing-The-remote-host-closed-the-connection-The-error-code-is-0x80070057__633882307305519259_blog.htm

The following stack-overflow post might also be of interest:

"The remote host closed the connection" in Response.OutputStream.Write

System.Web.HttpException: The remote host closed the connection , HttpException: The remote host closed the connection. The error code is 0x800704CD #4217. Closed. davidfowl opened this issue on Sep 25,  However if you can let us know which version of EO.Web you are using, we can look into our source code and see if there is anything else we can find. Also if it affects any features, please let us know as well.

One can reproduce the error with the code below:

public ActionResult ClosingTheConnectionAction(){
   try
   {
      //we need to set buffer to false to
      //make sure data is written in chunks
      Response.Buffer = false;  
      var someText = "Some text here to make things happen ;-)";
      var content = GetBytes( someText );

      for(var i=0; i < 100; i++)
      {
         Response.OutputStream.Write(content, 0, content.Length);
      }

      return View();
   }
   catch(HttpException hex)
   {
      if (hex.Message.StartsWith("The remote host closed the connection. The error code is 0x800704CD."))
            {
                //react on remote host closed the connection exception.
                var msg = hex.Message;
            }  
   }
   catch(Exception somethingElseHappened)
   {
      //handle it with some other code
   }

   return View();
} 

Now run the website in debug mode. Put a breakpoint in the loop that writes to the output stream. Go to that action method and after the first iteration passed close the tab of the browser. Hit F10 to continue the loop. After it hit the next iteration you will see the exception. Enjoy your exception :-)

The remote host closed the connection · Issue #625 , System.Web.HttpException (0x800704CD): The remote host closed the connection. The error code is 0x800704CD. at System.Web.Hosting. System.Web.HttpException (0x800704CD): The remote host closed the connection. The error code is 0x800704CD. at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)

I was getting this on an asp.net 2.0 iis7 Windows2008 site. Same code on iis6 worked fine. It was causing an issue for me because it was messing up the login process. User would login and get a 302 to default.asxp, which would get through page_load, but not as far as pre-render before iis7 would send a 302 back to login.aspx without the auth cookie. I started playing with app pool settings, and for some reason 'enable 32 bit applications' seems to have fixed it. No idea why, since this site isn't doing anything special that should require any 32 bit drivers. We have some sites that still use Access that require 32bit, but not our straight SQL sites like this one.

Giving the The error code is 0x800704CD, HttpException: The remote host closed the connection. The error code is 0x800704CD. at System.Web.Hosting.IIS7WorkerRequest. Dismiss Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

I got this error when I dynamically read data from a WebRequest and never closed the Response.

    protected System.IO.Stream GetStream(string url)
    {
        try
        {
            System.IO.Stream stream = null;
            var request = System.Net.WebRequest.Create(url);
            var response = request.GetResponse();

            if (response != null) {
                stream = response.GetResponseStream();

                // I never closed the response thus resulting in the error
                response.Close(); 
            }
            response = null;
            request = null;

            return stream;
        }
        catch (Exception) { }
        return null;
    }

Error: The remote host closed the connection. The error code is , gs-icon-32x32. Error: The remote host closed the connection. The error code is 0x800704CD. sp_Feed. Avatar. eliassal. Posts: 5. October 28, 2010 - 12:15 am. 1​. i have faced this problem in MINERGATE /socket_error_the_remote_host_closed_the_connection/ you must sign out and go to C:\Users\yourName\AppData\Local\minergate.ethash-minergate and then delete all files in this folder. good lu

Error 0x80072746 The remote host closed the connection., The error code is 0x80072746. at System.Web.Hosting.​ISAPIWorkerRequestInProcForIIS6.FlushCore(Byte[] status, Byte[] header, Int32  The error code is 0x800704CD.")) { //react on remote host closed the connection exception. var msg = hex.Message; } } catch(Exception somethingElseHappened) { //handle it with some other code } return View(); } Now run the website in debug mode. Put a breakpoint in the loop that writes to the output stream.

HttpException: The remote host closed the connection , System.Web.HttpException (0x800703E3): The remote host closed the connection. The error code is 0x800703E3. at System.Web.Hosting. Our App was written in MVC .net and we are getting "The remote host closed the connection" Exception for some user as they navigate the page but some other user works just fine. I've look at the Windows Log > Application and here is what got recorded.

The remote host closed the connection. The error code is - html, I am getting this error: The remote host closed the connection. The error code is 0x800704CD and don't know why. I get about 30 a day. I can't reproduce the  Check in both Server: IIS HTTPHANDLER Settings are the same. Check app pool -> Advance Settings that both sites are either 32 bit applications enabled or disabled. Sometimes 'enabling 32 bit applications' fixes the error 0x800704CD

Comments
  • I don't offer any file downloads on my site. Would downloading page content cause it as well?
  • Yes it would, looking at the stack trace System.Web.HttpResponse.Flush() means any kind of response. I've just found this, it may help you get to the route of the problem where viewstate is very large and users are clicking too quick which can cause this exception.
  • Do you know if this produces an error to the user or just a hidden one?
  • My own investigations into this show that on the users sees nothing out of the ordinary. Have you had any complaints from customers/clients?
  • No, none. Thanks for the help.
  • Big ups for the Response.IsClientConnected !
  • enabling 32 bit applications fixed it for me as well. Thanks !
  • This fails miserably when the server culture is not English (since the message would be in another language). Just use ErrorCode property of the exception (that should equal 2147943629, HRESULT 0x800704CD).
  • Correction: the ErrorCode for HRESULT 0x800704CD is -2147023667.
  • I have never used non English server culture, but I see your problem. Never the less, you can change that one line of code to handle different server cultures, like the one you suggested