os-js / osjs-server

OS.js Server Module
https://manual.os-js.org
Other
19 stars 21 forks source link

server websockets fails when the application is closed. #69

Open mahsashadi opened 1 year ago

mahsashadi commented 1 year ago

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?

andersevenrud commented 1 year ago

You can probably use ws.readyState to see if the socket is open or not.