Added IPKVM timeout handling.
Ylian Saint-Hilaire committed
Dec 10, 2021 at 16:44 UTC
cfeab353321af148948262f0c1d9c9d97875c087
1 file changed
+6
-3
meshipkvm.js
+6
-3
@@ -318,7 +318,8 @@ function CreateRaritanKX3Manager(parent, hostname, port, username, password) {
318
res.on('data', function (d) { })
319
fetchInitialInformation();
320
})
321
- req.on('error', function (error) { setState(0); })
321
+ req.on('error', function (error) { setState(0); });
322
+ req.on('timeout', function () { setState(0); });
323
req.write(data);
324
req.end();
325
}
@@ -343,7 +344,8 @@ function CreateRaritanKX3Manager(parent, hostname, port, username, password) {
344
if (res.headers['set-cookie'] != null) { for (var i in res.headers['set-cookie']) { if (res.headers['set-cookie'][i].startsWith('pp_session_id=')) { obj.authCookie = res.headers['set-cookie'][i].substring(14).split(';')[0]; } } }
345
res.on('data', function (d) { })
346
});
346
- req.on('error', function (error) { setState(0); })
347
+ req.on('error', function (error) { setState(0); });
348
+ req.on('timeout', function () { setState(0); });
349
req.end();
350
}
351
@@ -508,7 +510,8 @@ function CreateRaritanKX3Manager(parent, hostname, port, username, password) {
510
func(obj, tag, Buffer.concat(data), res);
511
});
512
});
511
- req.on('error', function (error) { console.log(error); setState(0); })
513
+ req.on('error', function (error) { setState(0); });
514
+ req.on('timeout', function () { setState(0); });
515
req.end();
516
}
517