Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to know the device logout and actually stopped sending the packets #29

Open
jAddict7 opened this issue Apr 21, 2019 · 0 comments
Open

Comments

@jAddict7
Copy link

jAddict7 commented Apr 21, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant