Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
the_session.readVariableValue(serverStatus_State_Id, function (err, dataValue) {
if (err) {
console.log(" warning : ClientSessionKeepAliveManager#ping_server ".cyan, err.message.yellow);
self.stop();
/**
* @event failure
* raised when the server is not responding or is responding with en error to
* the keep alive read Variable value transaction
*/
self.emit("failure");
} else {
if (dataValue.statusCode === StatusCodes.Good) {
const newState = ServerState.get(dataValue.value.value);
//istanbul ignore next
if (newState !== self.lastKnownState) {
console.log(" Server State = ", newState.toString());
}
self.lastKnownState = newState;
}
self.emit("keepalive",self.lastKnownState);
}
callback();
});
};