Distinguish socket ending from other end reasons

This commit is contained in:
Gjum 2018-12-22 05:33:05 +01:00 committed by GitHub
parent 8bccc3cb75
commit 66e4bbc3b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) => {