I usually implement a two way heartbeat, server sends a heartbeat message and client sends one back. If I want to check for stale connections I'll include a sequence number in the heartbeats and check responses come back in a certain time period.
I've avoided using the ping methods, I prefer to treat a heartbeat like any other method
On Wednesday, 24 July 2013, Robert Schiffman wrote:
I'm trying to find the best solution for keeping a websocket connection alive, so that the connection doesn't timeout when idle. I've thought of trying to implement a ScheduledExecutorService, but not sure how to go about that in context of a BaseWebSocketHandler to call ping on the connection. Or would it be better to implement on client side?
You received this message because you are subscribed to the Google Groups "Webbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webbit+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.