Existing connection was forcibly closed by remote host with WCF

We have wcf pub / sub setup, using reliable sessions through netTcpBinding, and on the same machine, where both the publishing service and the subscription service are located in console applications, we get the above error. This machine is in a working group. In another place that we deployed, the machine is in a domain and is working fine. My knowledge of wcf is somewhat limited, and it has just been shared with me, so please be patient. Does anyone have any tips for fixing this error?

The complete exception is below:

System.ServiceModel.CommunicationException The socket connection was aborted. This may be due to an error processing your message or an excess of the receiving time by the remote host or a network resource problem. The local socket timeout was "10675199.02: 48: 05.4775807".
in System.ServiceModel.Channels.SocketConnection.EndRead () in System.ServiceModel.Channels.DelegatingConnection.EndRead () in System.ServiceModel.Channels.TracingConnection.EndRead () in System.ServiceModel.Channels.ConnectionStreamReadAsead in System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.OnAsyncReadComplete (object state) in System.ServiceModel.Channels.TracingConnection.TracingConnectionState.ExecuteCallback () in System.ServiceModel.Channels.SocketConnection.onnection.connection.connection.connection .AsyncReadCallback (Boolean hasResult, Int32 error, Int32 bytesRead) in System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame (UInt32 error, UInt32 bytesRead, NativeOverlappedClement * IOnOverlapped) in System.ThreadinterConformalIclient_Illocated_Ill NativeOverlapped * pOVERLAP) Internal exception:
System.Net.Sockets.SocketException
An existing connection was forcibly closed by the remote host
in System.ServiceModel.Channels.SocketConnection.EndRead () in System.ServiceModel.Channels.DelegatingConnection.EndRead () in System.ServiceModel.Channels.TracingConnection.EndRead () in System.ServiceModel.Channels.ConnectionStreamReadAsead in System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.OnAsyncReadComplete (object state) in System.ServiceModel.Channels.TracingConnection.TracingConnectionState.ExecuteCallback () in System.ServiceModel.Channels.SocketConnection.onnection.connection.connection.connection .AsyncReadCallback (Boolean hasResult, Int32 error, Int32 bytesRead) in System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame (UInt32 error, UInt32 bytesRead, NativeOverlappedClement * IOnOverlapped) in System.ThreadinterConformalIclient_Illocated_Ill NativeOverlapped * pOVERLAP)

My binding configuration is as follows:

<netTcpBinding> <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"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="524288" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="true"/> <security mode="Transport" transport="" clientCredentialType="Windows" protectionLevel="EncryptAndSign" message=""/> </binding> </netTcpBinding> 

End point:

 <endpoint address="net.tcp://localhost:8000/SubscriptionService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_ISubscriptionService" contract="SubscriptionService.ISubscriptionService" name="NetTcpBinding_ISubscriptionService" /> 
+8
wcf
source share
2 answers

Well, I found out what my problem was.

The service to which the client application was connecting had mxConnection 10. We also used SecureMessaging and had listenBacklog of 1. Changed maxConnections to 100 and listBacklog to 200, and all this works fine.

+3
source share

For me, the problem was that I did not have the correct help for the service (from the development machine to the production machine).

+2
source share

All Articles