Client waits till pingTimeout after the machine awakes from sleep #4370
Unanswered
ManojkumarV
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As per the documentation, the client will wait for
pingInterval + pingTimeout ms
to reconnect the socket. But when the machine sleeps for a longer period and wakes up the client will still wait forpingInterval + pingTimeout
ms before reconnecting but the server would have already disconnected the socket.As a work around we thought of running a timer for every one second and match the last ping time with the current time and reconnect is manually if the difference between last ping time received and the current time is larger than
pingInterval + pingTimeout
.But when the socket is disconnected manually we will get "namespace disconnect" as reason in the server. But we would like to get "ping timeout" as reason in this scenario because we are having different handling for different scenarios.
Is there any way to achieve our need?
Beta Was this translation helpful? Give feedback.
All reactions