Skip to content

Feature request: ping support for detecting bad connections #21

Open

Description

@Sebbb

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

Activity

  1. unasuke commented on May 5, 2023

    @unasuke
    Collaborator

    "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.

  2. dwery commented on Jan 3, 2025

    @dwery

    I'd love to have it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions