emscripten-core / emscripten-core/emscripten
[QUESTION] How can I check if my WebSocket client is connected before sending message?
Open
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
I've got a server that automatically disconnects WebSocket clients after some time of inactivity. Is there any way I can check if the client is connected and, if not, reconnect before running `emscripten_websocket_send_utf8_text(ws, msg)`? Currently, I get the `WebSocket is already in CLOSING or CLOSED state.` error printed to the console.
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.