robtaussig / react-use-websocket

React Hook for WebSocket communication
MIT License
1.6k stars 136 forks source link

Websocket readyState remains CONNECTING after system wakes up from sleep ( > 10 mins) #199

Open Saranya-Sivanandham opened 1 year ago

Saranya-Sivanandham commented 1 year ago

We need to maintain the websocket connection for minimum of 30 mins. So, the configuration goes as below retryOnError:true, shouldReconnect : (didUnmount === false) reconnectAttempts : 3

This works perfectly, when we have the system is logged in and there is no activity in browser. On the other hand, if the system falls asleep for around 10 mins and we log in back, websocket readyState remains as connecting.