handle engine.io websocket errors more gracefully

This commit is contained in:
Roman Shtylman
2014-02-25 11:54:40 -05:00
parent 54ba65ba1f
commit bc80e37fff

View File

@@ -218,6 +218,11 @@ module.exports = function(opt) {
eio_sockets.push(socket);
socket.send(JSON.stringify(stats));
socket.on('error', function(err) {
log.error(err);
socket.close();
});
socket.on('close', function() {
// remove from socket pool so no more updates are sent