mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-11 23:13:21 -05:00
Fix for #2498
This commit is contained in:
parent
4883f5f26f
commit
fd5eb3efca
@ -452,7 +452,12 @@ var CreateWsmanComm = function (host, port, user, pass, tls, tlsoptions, mpsConn
|
|||||||
//obj.Debug("xxOnSocketClosed");
|
//obj.Debug("xxOnSocketClosed");
|
||||||
obj.socketState = 0;
|
obj.socketState = 0;
|
||||||
if (obj.socket != null) {
|
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 {
|
try {
|
||||||
if (obj.mpsConnection == null) {
|
if (obj.mpsConnection == null) {
|
||||||
obj.socket.destroy();
|
obj.socket.destroy();
|
||||||
|
Loading…
Reference in New Issue
Block a user