From 09d5c1ee371885b97af95b72e3f9950fd108b273 Mon Sep 17 00:00:00 2001 From: Stanislav Sinyagin Date: Mon, 6 Jan 2020 22:56:27 +0100 Subject: [PATCH] Issue #84 -- emit esl::end on socket::close net.Socket emits "end" only on successful closing, but it emits "close" in error conditions as well. --- lib/esl/Connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/esl/Connection.js b/lib/esl/Connection.js index 0d569b3..5f9306b 100644 --- a/lib/esl/Connection.js +++ b/lib/esl/Connection.js @@ -98,7 +98,7 @@ var Connection = module.exports = function() { } //emit end when stream closes - this.socket.on('end', function() { + this.socket.on('close', function() { self.emit('esl::end'); self.socket = null; });