1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00
This commit is contained in:
Ylian Saint-Hilaire 2021-04-11 22:44:43 -07:00
parent 775457e2b9
commit 112298cf84
2 changed files with 7 additions and 2 deletions

View file

@ -471,7 +471,12 @@ var CreateWsmanComm = function (host, port, user, pass, tls, tlsoptions, mpsConn
obj.destroy = function () {
if (obj.socket != null) {
if (obj.socket.removeAllListeners) { obj.socket.removeAllListeners(); }
if (obj.socket.removeAllListeners) {
// Do not remove the error handler since it may still get triggered.
obj.socket.removeAllListeners('data');
obj.socket.removeAllListeners('close');
obj.socket.removeAllListeners('timeout');
}
try {
if (obj.mpsConnection == null) {
obj.socket.destroy();