Permalink
Browse files

client: fix possible double reconnection

  • Loading branch information...
1 parent 35e127e commit 53cd731866537bed742143602d31dd8da7c74fb9 @indutny indutny committed Nov 5, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 server-plugin/www/client.js
@@ -311,10 +311,15 @@ define(function(require, exports, module) {
_self.transport.on("disconnect", ondisconnect);
_self.transport.on("error", ondisconnect);
+ var once = false;
function ondisconnect(reason) {
// Ignore probe errors
if (/probe error/i.test(reason)) return;
+ // Only one try to reconnect
+ if (once) return;
+ once = true;
+
if (_self.debug) {
log("Disconnect socket: " + reason);
}

0 comments on commit 53cd731

Please sign in to comment.