Re: [webbit] Best way of keeping websocket alive

Skip to first unread message

Neil Dunn

Jul 27, 2013, 7:54:42 AM7/27/13
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
For more options, visit
Reply all
Reply to author
0 new messages