nodejitsu/nssocket — pull request #23 by vote539 (2014-08-23 21:02:33+00:00)
Title: Marking NsSocket as disconnected prior to firing "close" event

When the underlying socket was disconnected, NsSocket would fire its "close" event prior to marking itself as disconnected via the `this.connected` property. If the listener to the "close" event triggered downstream functions that attempted to call `nssocket.send`, they would not be able to tell that the socket is disconnected, and a low-level *net.js* error would be thrown ("Error: This socket has been ended by the other party").