Playback Structure: WebSocket Connection Timeout

I have a device that connects to a server (written in Scala and Play) through a WebSocket. When I turn off the device, the connection remains open. Is there a way to set a keepalive connection timeout to connect to a WebSocket in the Play platform to check if the client endpoint is turned off. Thanks.

+7
websocket playframework keep-alive
source share
1 answer

More recently, a problem arose. The solution we settled on was to implement a beat strategy (ping-pong).

So, every 5 seconds, for example, send a ping message and wait for a pong response, and then delete the connection (the actor in our case) to the subscriber if the message is not received.

0
source share

All Articles