Created
August 9, 2015 16:12
-
-
Save prawnsalad/bbc34e9fc69a6c6de7e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IrcConnection.prototype.end = function (data) { | |
var that = this; | |
if (!this.socket) { | |
return; | |
} | |
this.requested_disconnect = true; | |
if (data && this.connected) { | |
// Once the last bit of data has been sent, then re-run this function to close the socket | |
this.write(data, true, function() { | |
that.end(); | |
}); | |
return; | |
} | |
this.socket.destroy(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment