Skip to content

Why does the server send a ping packet from version 3? #4094

Answered by darrachequesne
evgencode asked this question in Q&A
Discussion options

You must be logged in to vote

Please check the reasoning here: https://socket.io/blog/engine-io-4-release/#heartbeat-mechanism-reversal

After analysis, it seems to be caused by delayed timers on the client-side. Those timers are used in the ping-pong mechanism which helps to ensure the connection between the server and the client is still healthy. A delay on the client-side meant the client sent the ping packet too late, and the server considered that the connection was closed.

That's why the ping packets will now be sent by the server, and the client will respond with a pong packet.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by evgencode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants