System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

issue:WCF application, when the NetTCP client calls the server-side remote method (there are many remote methods, the server-side cpu/memory is normal). The following errors occur very occasionally every day.

evn:windows 2008 r2, .net framework 4.5

error info:

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 ‘00:01:00’. —> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.ServiceModel.Channels.SocketConnection.Write(Byte buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)

service setting: NetTcpBinding: listenBacklog=“1000”,maxConnections=“1000” ReceiveTimeout=“12:00:00”,percall ServiceThrottling : maxConcurrentCalls=“1000”,percall DataContractSerializer :maxItemsInObjectGraph=“2147483647”

client setting: TcpBinding CloseTimeout=“00:01:00” OpenTimeout=“00:00:10” ReceiveTimeout=“00:01:00” SendTimeout=“00:01:00” TransferMode=“Buffered” ListenBacklog=“1000” MaxBufferPoolSize=“1073741824” MaxBufferSize=“1073741824” MaxConnections=“100” MaxReceivedMessageSize=“1073741824” UseDefaultWebProxy=“false” HostNameComparisonMode=“StrongWildcard”> ReaderQuotas MaxArrayLength=“163840000” MaxBytesPerRead=“1048576” MaxDepth=“256” MaxNameTableCharCount=“163840000” MaxStringContentLength=“163840000”

addition info: This generally means that the remote side closed the connection (usually by sending a TCP/IP RST packet). If you’re working with a third-party application, the likely causes are: You are sending malformed data to the application The network link between the client and server is going down for some reason You have triggered a bug in the third-party application that caused it to crash The third-party application has exhausted system resources It’s likely that the first case is what’s happening.

You can fire up Wireshark to see exactly what is happening on the wire to narrow down the problem. Without more specific information, it’s unlikely that anyone here can really help you much.

.NET Foundation Website | Blog | Projects | Code of Conduct