title: Cannot access a disposed object. Sockets C#
body: <p>I use sockets, and when I try to close the socket, I get an </p>
  
  <blockquote>
    <p>ObjectDisposedException: Cannot access a disposed object Object name: 'System.Net.Sockets.Socket'.</p>
  </blockquote>
  
  <p>exception.</p>
  
  <pre><code>        socket.Close();
          socket.Shutdown(SocketShutdown.Both);  &lt;- exception
  </code></pre>
  
  <p>Why is this happening? why does the garbage collector clean it out?</p>