From 66e4bbc3b33b526fcb344d7f1a60bca9aaad503d Mon Sep 17 00:00:00 2001 From: Gjum Date: Sat, 22 Dec 2018 05:33:05 +0100 Subject: [PATCH] Distinguish socket ending from other end reasons --- src/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.js b/src/client.js index c08d7c5..982d4e6 100644 --- a/src/client.js +++ b/src/client.js @@ -132,7 +132,7 @@ class Client extends EventEmitter { this.socket.removeListener('close', endSocket) this.socket.removeListener('end', endSocket) this.socket.removeListener('timeout', endSocket) - this.emit('end', this._endReason) + this.emit('end', this._endReason || 'SocketClosed') } const onFatalError = (err) => {