From dfde3c442f8c1b4e5746330f1fc1324b463a8b2d Mon Sep 17 00:00:00 2001 From: MrBearman64 Date: Mon, 8 Mar 2021 14:58:46 +0100 Subject: [PATCH] Cover the case, when Socket is closed --- src/client.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client.js b/src/client.js index 97a8ccc..d4cc53d 100644 --- a/src/client.js +++ b/src/client.js @@ -189,6 +189,7 @@ class MumbleClient extends EventEmitter { connectDataStream (stream, callback) { if (this._dataStream) throw Error('Already connected!') this._dataStream = stream + this._dataStream.once('close', () => this._error('Socket closed!')) // Connect the supplied stream to the data channel encoder and decoder this._registerErrorHandler(stream)