title: How do I completely destroy a socket.io connection?
body: <p>I'm creating a browser chat from Socket.io and Node.js. Everything has been running smoothly, but I appear to be having a problem with disconnecting sockets. When I run <code>socket.disconnet();</code>, the server runs the <code>socket.on("disconnect",</code> event, but it doesn't actually remove the socket from internal listeners.</p>
  
  <p>When I run <code>socket.disconnect();</code> on a socket, the socket no longer recieves any new messages, but when the "disconnected" user sends a message, the server receives and sends it back to all clients. I want to create a proper <code>/kick</code> command but it's difficult when I have to restructure all of my code just to accomidate for a simple function.</p>
  
  <p>Commands like <code>socket.connection.destroy();</code>, <code>socket.end();</code>, and <code>socket.transport.destroy();</code> are invalid and undefined. Does anyone have any suggestions? I've been working on this problem for days and I haven't found any answer other than to set a <code>shutup</code> boolean to the socket and tell the message event to ignore specific sockets. Is this the best way? What happens if the user starts editing javascript code and I need a way from receiving other events from a client?</p>