Answer the question
In order to leave comments, you need to log in
How to speed up disconnect in socket.io?
I am writing a chat in NodeJS using socket.io. There was such a problem: if you turn off the Internet, then disconnect works somewhere in a minute, and if you close the tab or refresh, it works instantly. How can I speed up this event even when the Internet is turned off? There was an attempt to periodically send an event to the server to check the connection and set a timer, if the event does not repeat, the timer will not be canceled and the event will fire as if disconnected, but this is very strange and does not work.
Answer the question
In order to leave comments, you need to log in
https://developer.mozilla.org/en/docs/Online_and_o...
// EDIT
And why is everyone so shy about reading docs?)
DOCS .
pingTimeout (Number): how many ms without a pong packet to consider the connection closed (60000)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question