title: An existing connection was forcibly closed by the remote host with WCF
body: <p>We have a wcf pub/sub setup using reliable sessions via netTcpBinding and on one machine where both the publication service and subscription service are being hosted in a console applications we get the above error. This machine is in a workgroup. Everywhere else we have deployed the machine is in a domain and it works fine. My knowledge of wcf is somewhat limited and this has just been handed to me so please be patient. Does anyone have any advice on how to resolve this error?</p>
  
  <p>The full exception is below:</p>
  
  <blockquote>
    <p>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'.<br>
    at System.ServiceModel.Channels.SocketConnection.EndRead()
    at System.ServiceModel.Channels.DelegatingConnection.EndRead()
    at System.ServiceModel.Channels.TracingConnection.EndRead()
    at System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.HandleRead()
    at System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.OnAsyncReadComplete(Object state)
    at System.ServiceModel.Channels.TracingConnection.TracingConnectionState.ExecuteCallback()
    at System.ServiceModel.Channels.SocketConnection.FinishRead()
    at System.ServiceModel.Channels.SocketConnection.AsyncReadCallback(Boolean haveResult, Int32 error, Int32 bytesRead)
    at System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
    at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
    Inner exception:<br>
    System.Net.Sockets.SocketException<br>
    An existing connection was forcibly closed by the remote host<br>
    at System.ServiceModel.Channels.SocketConnection.EndRead()
    at System.ServiceModel.Channels.DelegatingConnection.EndRead()
    at System.ServiceModel.Channels.TracingConnection.EndRead()
    at System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.HandleRead()
    at System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.OnAsyncReadComplete(Object state)
    at System.ServiceModel.Channels.TracingConnection.TracingConnectionState.ExecuteCallback()
    at System.ServiceModel.Channels.SocketConnection.FinishRead()
    at System.ServiceModel.Channels.SocketConnection.AsyncReadCallback(Boolean haveResult, Int32 error, Int32 bytesRead)
    at System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
    at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)</p>
  </blockquote>
  
  <p>My binding configuration is as follows:</p>
  
  <pre><code>&lt;netTcpBinding&gt;
      &lt;binding name="NetTcpBinding_ISubscriptionService"
               closeTimeout="00:01:00"
               openTimeout="00:01:00"
               receiveTimeout="00:10:00"
               sendTimeout="00:01:00"
               transactionFlow="false"
               transferMode="Buffered"
               transactionProtocol="OleTransactions"
               hostNameComparisonMode="StrongWildcard"
               listenBacklog="10"
               maxBufferPoolSize="524288"
               maxBufferSize="65536"
               maxConnections="10"
               maxReceivedMessageSize="65536"&gt;
          &lt;readerQuotas maxDepth="32"
                        maxStringContentLength="8192"
                        maxArrayLength="524288"
                        maxBytesPerRead="4096"
                        maxNameTableCharCount="16384" /&gt;
          &lt;reliableSession ordered="true"
                           inactivityTimeout="00:10:00"
                           enabled="true"/&gt;
          &lt;security mode="Transport"
                    transport=""
                    clientCredentialType="Windows"
                    protectionLevel="EncryptAndSign"
                    message=""/&gt;
      &lt;/binding&gt;
  &lt;/netTcpBinding&gt;
  </code></pre>
  
  <p>The Endpoint is:</p>
  
  <pre><code>&lt;endpoint address="net.tcp://localhost:8000/SubscriptionService"
            binding="netTcpBinding" 
            bindingConfiguration="NetTcpBinding_ISubscriptionService" 
            contract="SubscriptionService.ISubscriptionService" 
            name="NetTcpBinding_ISubscriptionService" /&gt;
  </code></pre>