Is there something that I can do on the client side to detect that the socket.io websocket is not available? Something along the lines of:
- server starts as per usual
- clients connect
- messages are sent back and forth between server and client(s)
- server shuts down (no longer available)
- warn the connected clients that the server is not available
I tried to add the 'error' and 'connect_failed' options on the client side but without any luck, those didn't trigger at all. Any ideas from anyone how I can achieve this?
var sio = io.connect(); sio.socket.on('error', function (reason){ console.error('Unable to connect Socket.IO', reason); });did you try?