From 3ab78d63dbd2569abaf0d588230fa8c1afc1048a Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Wed, 6 Jan 2016 01:54:01 +0100 Subject: [PATCH] fix(server): Handle new socket.io internal format. Fixes #1782 --- lib/server.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/server.js b/lib/server.js index e34c3b9de..9de3de03e 100644 --- a/lib/server.js +++ b/lib/server.js @@ -311,7 +311,8 @@ Server.prototype._start = function (config, launcher, preprocess, fileList, webS // TODO(vojta): change the client to not send the event (if disconnected by purpose) var sockets = socketServer.sockets.sockets - sockets.forEach(function (socket) { + Object.keys(sockets).forEach(function (id) { + var socket = sockets[id] socket.removeAllListeners('disconnect') if (!socket.disconnected) { // Disconnect asynchronously. Socket.io mutates the `sockets.sockets` array