title: c# cannot access a disposed object
body: <p>I am making an server/client application.</p>
  
  <p>I set server socket to listening, and set BeginAccept() method.
  And when I closed server socket (Socket.Close()) to turn off server,
  an exception thrown from BeginAccept() method's async callback method.
  I inspected exception, and I found the exception saying me this:</p>
  
  <p>Message "Cannot access a disposed object named
  "System.Net.Sockets.Socket".
  Object name: "System.Net.Sockets.Socket"." String</p>
  
  <p>In my opinion, this is just this: "The socket disposed when I call
  Socket.Close() method, but the callback did not released before the
  socket closed."</p>
  
  <p>i did search on the net and found this is not an error but a designed exception as beginaccept was cancelled.</p>
  
  <p>my question how do i handle this excepton? what processing there needs to be for it?</p>
  
  <p>I'm just going to treat it as a normal event:</p>
  
  <pre><code>      OnNetworkEvents eventArgs = new OnNetworkEvents(false, "Ready", e.Message);
        OnUpdateNetworkStatusMessage(this, eventArgs);
  </code></pre>
  
  <p>any comments are still welcome.</p>