When a device sending packets to server A and its changed to server B. Whether server A is able to know the device is logged out completely?
In server.js,
connection.on('end', function(){
_this.devices.splice(_this.devices.indexOf(connection), 1);
connection.device.emit('disconnected');
});
In device.js,
this.on('disconnected', function(){
_this.logout();
});
this.logout = function(){
this.do_log('Device has been logged out.');
this.loged = false;
this.adapter.logout(); // No code in gt06n
// code to send server as the device_id logout
};
But disconnected event is running very often. Is there a better solution to identify the device got disconnected completed?