8000 fix: pingTimeout is not reset while receiving messages by cdewbery · Pull Request #706 · socketio/engine.io-client · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: pingTimeout is not reset while receiving messages #706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

cdewbery
Copy link
Contributor

Note: the engine.io.js file is the generated output of make engine.io.js, and should not be manually modified.

The kind of change this PR does introduce

  • a bug fix
  • a new feature
  • an update to the documentation
  • a code change that improves performance
  • other

Current behaviour

In the case where a client is has a slow connection it is possible for the pingTimeout to trigger while messages
are still being transferred from the server. My understanding is that this is because the ping messages are sent "in-band" with all the other messages which means they can essentially become blocking in the queue behind multiple
other messages.

New behaviour

This PR makes the assumption that if the client is receiving messages, the link must be ok, so will reset the ping
timeout for any message that arrives at the client. This means that ping timeouts will not occur as long
as a single message can be transferred within the configured ping timeout + ping interval.

It appears the server side implementation of engine.io also uses a similar mechanism.
https://github.com/socketio/engine.io/blob/main/lib/socket.ts#L147

Other information (e.g. related issues)

darrachequesne pushed a commit that referenced this pull request Aug 1, 2023
The client will now match the behavior of the server.

See also: socketio/engine.io@be7b4e7
@darrachequesne
Copy link
Member

Merged as ed34a45 and released in 6.5.2. Thanks a lot 👍

7C92

@darrachequesne darrachequesne added this to the 6.5.2 milestone Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0