I am using socket.io,can I detect the disconnect reason from disconnect event ? I can see in log files like this
info: transport end (booted) info: transport end (close timeout) info: transport end (error)
I want to get the reason (booted,close timeout,error) I will use like this:
socket.on('disconnect', function(){
console.log('User 1 disconnected because '+reason);
});
Can I get the reason ?
EDIT:I found the solution
socket.on('disconnect', function(reason){
console.log('User 1 disconnected because '+reason);
});