none
An existing connection was forcibly closed by the remote host

    Question

  • Hi,

    I am getting An existing connection was forcibly closed by the remote host while trying to get data from a CRM service.

    Following is some of the trace lines from my log file


       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    ----------------------------- Inner Exception Info -----------------------------
    Message: The underlying connection was closed: An unexpected error occurred on a receive.
    Source: System
    Stack Trace:    at System.Net.HttpWebRequest.GetResponse()
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
    ----------------------------- Inner Exception Info -----------------------------
    Message: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
    Source: System
    Stack Trace:    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
       at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
       at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
    ----------------------------- Inner Exception Info -----------------------------
    Message: An existing connection was forcibly closed by the remote host
    Source: System
    Stack Trace:    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

    i am fetching 300 records and when i deleted 100 records and try to fetch i am getting the records in to my datagrid. but if i am trying for 300 i am getting above error.

    and it is getting within 1min of execution

    please help me out to resolve

    thanks in advance


    Ramesh Naidu
    Monday, September 19, 2011 4:36 PM

Answers

All replies

  • To make it easier to troubleshoot, please post your binding information from the web.config or app.config file as well.  Have you tried bumping up the maxReceivedMessageSize attributes? We've noticed that WCF will throw this error for just about anything, so what the error says and what the resolution may be may not line up.
    Monday, September 19, 2011 4:50 PM
  • hi

     the following config is from service side

      <bindings>
          <wsHttpBinding>
            <binding name="WSHttpBinding_abcService" closeTimeout="00:10:00"
              openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
              bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
              maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
              messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
              allowCookies="false">
              <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00"
                enabled="false" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
              <message clientCredentialType="Windows" negotiateServiceCredential="true"
                  algorithmSuite="Default" establishSecurityContext="true" />
              </security>
            </binding>

     

     

    and the following code is from website(application) side

     

    <bindings>
          <wsHttpBinding>
            <binding name="WSHttpBinding_abcService" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
              <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
                <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" />
              </security>
            </binding>
           

     

    plz let me know if i need to do any changes

     

    thanks in advance

    • Edited by CRM-Tech Tuesday, September 20, 2011 9:06 AM format
    Tuesday, September 20, 2011 9:02 AM
  • Looks like you have access to the service. So please enable WCF tracing on the service side.
    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    Windows Azure Technical Forum Support Team Blog
    • Marked as answer by CRM-Tech Thursday, September 22, 2011 9:39 AM
    Wednesday, September 21, 2011 1:39 AM