mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 11:01:52 +00:00
Fix for #2498
This commit is contained in:
parent
4883f5f26f
commit
fd5eb3efca
1 changed files with 6 additions and 1 deletions
|
@ -452,7 +452,12 @@ var CreateWsmanComm = function (host, port, user, pass, tls, tlsoptions, mpsConn
|
|||
//obj.Debug("xxOnSocketClosed");
|
||||
obj.socketState = 0;
|
||||
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();
|
||||
|
|
Loading…
Reference in a new issue