title: How to Gracefully Close a Socket from the Server
body: <p>On the server side, I'm trying to gracefully close a connected socket.  I know the proper sequence of events on the Socket should be:</p>
  
  <ol>
  <li><p>socket Shutdown with the SocketShutdown.Send option</p></li>
  <li><p>loop/wait until a socket Receive returns with 0 bytes</p></li>
  <li><p>socket Close</p></li>
  </ol>
  
  <p>I have a few questions:</p>
  
  <ol>
  <li><p>what if Socket.Receive never returns (with 0 bytes)?  will we be stuck trying to close the socket forever?</p></li>
  <li><p>whenever i call Close on the server, the Client always receives "an existing connection was forcibly closed by a remote host" exception on their end.  how can i have the client notified of this close "gracefully"?</p></li>
  <li><p>on the server, if I'm using Async Begin/EndReceive calls, whenever I call Close on the socket, it ALWAYS results in an ObjectDisposedException on the Begin/EndReceive thread.  Is there no way to Close a socket without this exception from occurring?</p></li>
  </ol>