Skip to content
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

pingInterval should just force close the connection if the server doesn't pong #91

Closed
lmcd opened this issue May 18, 2021 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@lmcd
Copy link

lmcd commented May 18, 2021

pingAndScheduleNextTimeoutTask in WebSocket should not call close (as this assumes the connection is still open), and should rather just immediately close the channel.

@lmcd lmcd added the bug Something isn't working label May 18, 2021
@0xTim
Copy link
Member

0xTim commented May 19, 2021

What's the downside of sending a close to the client before shutting the connection down? If there's a network delay or the server is still processing some data it will at least get a close with the right error code it can then handle rather than an instant kill

@lmcd
Copy link
Author

lmcd commented May 19, 2021

I think I've misread the code here, as the close promise seems to succeed after the close signal is dispatched, rather than waiting for the full roundtrip.

I was running into long delays/timeouts, but I think the source of the issue is in fact this: #90 (comment)

IMO, if the pingInterval is set to 2 seconds, I should have a way of immediately knowing when this 2 second timeout has elapsed, rather than instead waiting 7 seconds for onClose to actually fire.

@0xTim
Copy link
Member

0xTim commented May 19, 2021

Ok I'll close this in favour of #90 then

@0xTim 0xTim closed this as completed May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants