title: Asynchronous Server Socket error: An existing connection was forcibly closed by the remote host
body: <p>I am using msdn Asynchronous Server Socket Example. <a href="http://msdn.microsoft.com/en-us/library/fx6588te%28v=vs.110%29.aspx" rel="nofollow">link</a></p>
  
  <p>On this server i am getting data in string format from a device.</p>
  
  <p>The problem is after some time of getting data successfully i get below error and application hang:-</p>
  
  <p><strong>socket exception was unhandled:
  An existing connection was forcibly closed by the remote host.</strong></p>
  
  <p>c# debug shows error in this part of code.</p>
  
  <pre><code>listener.BeginAccept(
        new AsyncCallback(AcceptCallback),
        listener);
  </code></pre>
  
  <p>how  to resolve the error.</p>