No documentation.
Look at documentation.
It would be so great if there were some official documentation on the possible values for the "reason" value passed to the server side disconnect callback. Some I can discover on my own and make good guesses at ("ping timeout") but others are less clear ("transport close").
I'd like to try to handle some of them in different ways (and also for debugging purposes) but without knowing the possibilities or what they mean, it is rather difficult.
I have found:
client.disconnect()
)socket.disconnect()
action.I'd be willing to do a pull request for the docs, but I am wary of adding in wrong/incomplete information without some further confirmation.
I can`t find how to pass custom reason for disconnect or auth error
Any idea what could 'client error' reason mean?
Probably an error client side, I would guess some kind of uncaught js error that stopped js execution in the browser.
I've had a few also
@Ra1da35ma "io server disconnect" is a more general disconnect reason. You will also get this when you just shut down your socket.io server, an error/exception forces your server to close, or just your code closes a connected socket
I need to know explicitly whether it is a timeout or an active closed connection. Your documentation is useful.
It looks like this documentation now exists here for anybody that gets to this issue from Google.
Thanks @c1moore guess we can close this then.
Sorry for re-opening the issue. Regarding the transport close
that is the reason when page is closed/reloaded, it also happens some times in bad network conditions specifically when the ping packets are not delivered to the client. For the latter I need to handle it in the server side by waiting for the client to reconnect. Is there a way to properly distinguish between these two?
Most helpful comment
It looks like this documentation now exists here for anybody that gets to this issue from Google.