title: How to find cause and of the SocketException with message that an established connection was aborted by the software in your host machine?
body: <p>I know the similar question may have been asked many times, but I want to represent the behavior I'm seeing and find if somebody can help predict the cause of this.</p>
  
  <p>I am writing a windows service which connects to other windows service over TCP.
  There are 100 user entities of this, and 5 connections per each. These users perform their tasks using their individual connections.</p>
  
  <p>The application goes on withough seeing this problem for 1 or 2 days. Or sometimes show the problem right after starting (-rarely). The best run I had was like 4 to 5 days without showing this exception. And after that application died or I had to stop it for various reasons.</p>
  
  <p>I want to know what can be causing this? 
  Here is the stacktrace.</p>
  
  <p><code>System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---&gt; 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)
  </code></p>