When the server restarts, the socket.io client just waits until the server comes back online and reconnects, which gets you an invalid state of a user where they can see the incoming events but can't send any themselves.
I have seen this before on other msgroom servers and it's pretty annoying, since you can't really notice disconnects or restarts as a user.
So here's how I'm going to fix this:
When we receive the disconnect event on a socket, we call socket.disconnect() so we can be sure they won't reconnect.
We listen for the SIGINT signal, and when received we send a system message saying that the server is closing and disconnect all sockets so they don't reconnect automatically when the server restarts.
When the server restarts, the socket.io client just waits until the server comes back online and reconnects, which gets you an invalid state of a user where they can see the incoming events but can't send any themselves. I have seen this before on other msgroom servers and it's pretty annoying, since you can't really notice disconnects or restarts as a user.
So here's how I'm going to fix this:
socket.disconnect()
so we can be sure they won't reconnect.