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

Feature request: ping support for detecting bad connections #21

Open
Sebbb opened this issue May 4, 2023 · 2 comments
Open

Feature request: ping support for detecting bad connections #21

Sebbb opened this issue May 4, 2023 · 2 comments

Comments

@Sebbb
Copy link

Sebbb commented May 4, 2023

Hello,

this is somewhat related to #15, but not completely. I noticed that sometimes bad websocket connections aren't detected by ruby.

So, best practice would be to send a "ping" in regular intervals (ws.send(Time.now.to_i, {type: :ping })) and to do something when there is no reply.

I could implement all that in my code, but helper functions in the simple client would be great :)

Like a way to specify the ping interval, and after what time without reply something happens. E.g. it could emit a "ping_timeout" event.

Does this make sense, is that something that would be useful for more than me? :)

Thanks
Sebastian

@unasuke
Copy link
Collaborator

unasuke commented May 5, 2023

"ping_timeout", a configuration value that does nothing if nil (or 0 ?) is specified, would help existing users avoid dealing with breaking changes.

Anyone who waiting for this feature, please comment here.

@dwery
Copy link

dwery commented Jan 3, 2025

I'd love to have it

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

No branches or pull requests

3 participants