I have been suggested that if I ping the server every 15 minutes then I can extend a Websocket connection beyond 24 hours mark, is that correct?
No, ping server doesn’t guarantee that the server will not disconnect after 24-hour mark.
- Ping server and expect a pong response from server; this communication can be used to inspect the socket connection.
- Server could drop the connection after 24hr since the connection is initialized. So client should prepare for the disconnection.
So, is there any solution to extend websocket connection beyond 24h?
@Andrei_Petrascu, you should rotate connections regularly, before 24 hour mark, like every 8 hours. Then you can keep uninterrupted event stream for as long you need to.
1 Like