diff options
-rw-r--r-- | lib/realtime.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/realtime.js b/lib/realtime.js index d069a486..b50e05b2 100644 --- a/lib/realtime.js +++ b/lib/realtime.js @@ -97,7 +97,9 @@ var updater = setInterval(function () { for (var i = 0, l = note.socks.length; i < l; i++) { var sock = note.socks[i]; if (typeof sock !== 'undefined' && sock) { - sock.disconnect(true); + setTimeout(function () { + sock.disconnect(true); + }, 0); } } return callback(err, null); @@ -787,7 +789,9 @@ function connection(socket) { sock.emit('info', { code: 403 }); - return sock.disconnect(true); + setTimeout(function () { + sock.disconnect(true); + }, 0); } } } @@ -818,7 +822,9 @@ function connection(socket) { var sock = note.socks[i]; if (typeof sock !== 'undefined' && sock) { sock.emit('delete'); - return sock.disconnect(true); + setTimeout(function () { + sock.disconnect(true); + }, 0); } } }).catch(function (err) { |