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.
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 didsetConnectionLostTimeoutto 30 seconds. and override thesendPing()methodJava-WebSocket/src/main/java/org/java_websocket/client/WebSocketClient.java
Line 439 in a2c63db
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'ssendPing()Java-WebSocket/src/main/java/org/java_websocket/WebSocketImpl.java
Line 661 in a2c63db
Additional context
It's not causing any connection close issue, but I am just looking for a way o customize the send ping message.