alexwohlbruck / covalent

Internet connected lamps! For my senior capstone project💡⚛️🎓
https://alex.wohlbruck.com/project/covalent
2 stars 0 forks source link

Send ping/pong messages #24

Closed alexwohlbruck closed 2 years ago

alexwohlbruck commented 2 years ago

The websocket server times out after about 30 seconds of inactivity. In order to prevent this, the server must sing a ping every few (maybe 5) seconds and the client responds with a pong as soon as it is received.

https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#pings_and_pongs_the_heartbeat_of_websockets https://stackoverflow.com/questions/50876766/how-to-implement-ping-pong-request-for-websocket-connection-alive-in-javascript