From 96bf4016bce98299433afc2f13394540074dfe6d Mon Sep 17 00:00:00 2001 From: Alexander Penev Date: Mon, 5 Dec 2016 09:19:59 +0200 Subject: [PATCH] On socket end don't emit an additional event --- lib/protocol/Connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/protocol/Connection.js b/lib/protocol/Connection.js index ac087ae..d1ced47 100644 --- a/lib/protocol/Connection.js +++ b/lib/protocol/Connection.js @@ -241,7 +241,7 @@ Connection.prototype._addListeners = function _addListeners(socket) { function onend() { var err = new Error('Connection closed by server'); err.code = 'EHDBCLOSE'; - socket.emit('error', err); + onerror(err); } socket.on('end', onend); };