I know that a similar question could be asked many times, but I want to present the behavior that I see and find out if anyone can help predict the reason for this.
I am writing a Windows service that connects to another Windows service through TCP. In total there are 100 user objects and 5 connections for each. These users complete their tasks using their individual connections.
The application continues to see this problem for 1 or 2 days. Or sometimes show the problem immediately after starting (-rarely). The best run I had was like 4-5 days without showing this exception. And after that, the application died, or I had to stop it for various reasons.
I want to know what could be causing this? Here is the stacktrace.
System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.Security._SslStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security._SslStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.Write(Byte[] buffer, Int32 offset, Int32 count)
source share