Skip to content

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

@jAddict7

Description

@jAddict7

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions