none
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. RRS feed

  • Question

  • Hi,

    I'm getting below error with the custom binding. I have multiple services using the same binding.

    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 '10675199.02:48:05.4775807'.

    Below is how I have defined the custom binding

     <customBinding>
            <binding name="netTcp" closeTimeout="04:01:00" openTimeout="04:01:00" receiveTimeout="04:01:00" sendTimeout="04:01:00">
              <binaryMessageEncoding>
                <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
              </binaryMessageEncoding>
              <tcpTransport maxReceivedMessageSize="2147483647" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647">
                <connectionPoolSettings maxOutboundConnectionsPerEndpoint="8000"/>
              </tcpTransport>
            </binding>
          </customBinding>

    Below is how I have defined the Service Endpoints

    <service name="Service.DataAccessor">
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://localhost:8080/DataAccessor"/>
              </baseAddresses>
            </host>
            <endpoint address="" binding="customBinding" contract="Service.Interfaces.IDataAccessor" bindingConfiguration="netTcp"/>
            <endpoint address="mex" binding="customBinding" contract="IMetadataExchange" bindingConfiguration="netTcp" listenUriMode="Explicit"/>
          </service>
          <!--/////////////////////////////////////////////////////////////////////////////////////////////////-->
          <!--Filer-->
          <!--/////////////////////////////////////////////////////////////////////////////////////////////////-->
          <service name="Service.Filer">
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://localhost:8080/Filer"/>
              </baseAddresses>
            </host>
            <endpoint address="" binding="customBinding" contract="Service.Interfaces.IFiler" bindingConfiguration="netTcp"/>
            <endpoint address="mex" binding="customBinding" contract="IMetadataExchange" bindingConfiguration="netTcp" listenUriMode="Explicit"/>
          </service>
          

    Can you please help on why I'm getting this error and the solution.


    Thanks in advance.


    Sandeep

    Thursday, December 1, 2016 7:57 AM

All replies

  • Here is the stack trace of the error.

    <E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"><System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"><EventID>262256</EventID><Type>3</Type><SubType Name="Error">0</SubType><Level>2</Level><TimeCreated SystemTime="2016-12-01T16:12:28.9662594Z" /><Source Name="System.ServiceModel" /><Correlation ActivityID="{00000000-0000-0000-0000-000000000000}" /><Execution ProcessName="w3wp" ProcessID="13016" ThreadID="5" /><Channel /><Computer>FS205-PC</Computer></System><ApplicationData><TraceData><DataItem><TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error"><TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Channels.TcpConnectionResetError.aspx</TraceIdentifier><Description>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 '10675199.02:48:05.4775807'. The local IP address and port is [::1]:808. The remote IP address and port is [::1]:50430.</Description><AppDomain>/LM/W3SVC/1/ROOT/PitBoss.Service.Gateway-1-131250823265587250</AppDomain><ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/MessageTraceRecord"></ExtendedData><Exception><ExceptionType>System.ServiceModel.CommunicationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>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 '10675199.02:48:05.4775807'.</Message><StackTrace>   at System.ServiceModel.Channels.SocketConnection.ConvertTransferException(SocketException socketException, TimeSpan timeout, Exception originalException, TransferOperation transferOperation, Boolean aborted, String timeoutErrorString, TransferOperation timeoutErrorTransferOperation, SocketConnection socketConnection, TimeSpan remainingTime)
       at System.ServiceModel.Channels.SocketConnection.ConvertReceiveException(SocketException socketException, TimeSpan remainingTime)
       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)
       at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e)
       at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationAsyncFailure(SocketError socketError, Int32 bytesTransferred, SocketFlags flags)
       at System.Net.Sockets.SocketAsyncEventArgs.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
       at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
    </StackTrace><ExceptionString>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 '10675199.02:48:05.4775807'. ---&amp;gt; System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
       at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()
       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)
       --- End of inner exception stack trace ---</ExceptionString><InnerException><ExceptionType>System.Net.Sockets.SocketException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>An existing connection was forcibly closed by the remote host</Message><StackTrace>   at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()
       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)</StackTrace><ExceptionString>System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host
       at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted()
       at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs)</ExceptionString><NativeErrorCode>2746</NativeErrorCode></InnerException></Exception></TraceRecord></DataItem></TraceData></ApplicationData></E2ETraceEvent>


    Sandeep

    Thursday, December 1, 2016 4:50 PM
  • Hi Sandeep,

    Based on your code, it seems you want to implement two service contract in the same project. I made a test with below steps, but I failed to reproduce your issue.

    1. Create a console application, two services, add your configuration xml, host these services
    2. Add service reference by net.tcp address
    3. Call the two service from the same client, both works.

    Could you share us your detailed steps? And when did you get this error?

    I would suggest you try to configure Tracing to check the error message in service side.

    In addition, have your this thread MaxOutboundConnectionsPerEndpoint quota (10) has been reached, so the connection was closed and not reused by the listener resolved? If you have, it would be appreciated if you could share us your solution, if not, please feel free to keep following.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 2, 2016 2:40 AM