osjs-server
osjs-server copied to clipboard
server websockets fails when the application is closed.
Hi.
In server-side of my application I am tailing a log file and sending logs via ws
messages to client.
When I unexpectedly close the application, It faces an error:
Error: WebSocket is not open: readyState 3 (CLOSED)
How can I make server not to send its ws
messages when the app is closed?
You can probably use ws.readyState
to see if the socket is open or not.