Skip to content

How to send customized ping message on connectionLostTimeout interval #941

Description

@gharia

Describe what you would like to know or do
How to send a custom Ping message on connectionLostTimeout?

Describe the solution you'd considered
For creating a WS client, I am extending WebSocketClient. I did setConnectionLostTimeout to 30 seconds. and override the sendPing() method

@Override
  public void sendPing() {
    log.info("Sending ping");
    JsonObject pingObj = new JsonObject();
    pingObj.addProperty("id", "NGenerated guid id");
    pingObj.addProperty("type", "ping");
    this.send(pingObj.toString());
  }

I thought it would be simple, just to override sendPing(). But it is not the case. My overridden method never gets invoked. Rather it calls engine's sendPing()

Additional context
It's not causing any connection close issue, but I am just looking for a way o customize the send ping message.

Activity

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

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions