title: socket.io Removing specific listener
body: <p>I'm using Socket.io v0.9.16 and
  Chrome 34</p>
  
  <p>I'm trying to remove a specific listener, or unsubscribe from a specific subscription</p>
  
  <p>Something like this:</p>
  
  <pre><code>socket.on('testComplete',function(data){
      console.log('test complete',data);
  }); 
  
  function emitTest(){
      console.log('emitting test');
      socket.emit('test','first emit');
  }
  
  function removeListener(){
      socket.removeListener('testComplete');
  }
  </code></pre>
  
  <p>If I call the <code>emitTest</code> function, and then the <code>removeListener</code> function, I still see the <code>'test complete'</code> message when I call <code>emitTest</code> again. The listener should have been removed, if the socket function even works.</p>
  
  <p>I'm looking for a way to remove a <em>specific</em> listener that actually works.</p>
  
  <p><a href="https://stackoverflow.com/questions/9418697/how-to-unsubscribe-from-a-socket-io-subscription">This answer</a> says that removeListener doesn't work.</p>
  
  <p>Is there any downside to just doing this:</p>
  
  <pre><code>socket.removeListener=function(name){
          if(socket.$events.hasOwnProperty(name)){
              delete socket.$events[name];
          }
      };
  </code></pre>
  
  <p>I marked an answer as correct, but I'm using the above in my code since it works better with my design.</p>