Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reconnect loop after heartbeat timeout #533

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions bin/builder.js
Expand Up @@ -85,15 +85,13 @@ var baseTransports = {

/**
* Wrappers for client-side usage.
* This enables usage in top-level browser window, client-side CommonJS systems and AMD loaders.
* This enables usage in top-level browser window and client-side CommonJS systems.
* If doing a node build for server-side client, this wrapper is NOT included.
* @api private
*/
var wrapperPre = "\nvar io = ('undefined' === typeof module ? {} : module.exports);\n(function() {\n";

var wrapperPost = "\nif (typeof define === \"function\" && define.amd) {" +
"\n define([], function () { return io; });" +
"\n}\n})();";
var wrapperPost = "\n})();";


/**
Expand Down
12 changes: 6 additions & 6 deletions dist/socket.io.js
Expand Up @@ -1451,9 +1451,12 @@ var io = ('undefined' === typeof module ? {} : module.exports);
self.open();
}, this.socket.options['reopen delay']);*/

this.isOpen = false;
this.socket.onClose();
this.onDisconnect();
/* only call close if transport hasn't been swapped out already */
if (this.socket.transport === this) {
this.isOpen = false;
this.socket.onClose();
this.onDisconnect();
}
};

/**
Expand Down Expand Up @@ -3865,7 +3868,4 @@ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="Sho
, this
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what this is all about... I just re-ran make build and it removed this code.

);

if (typeof define === "function" && define.amd) {
define([], function () { return io; });
}
})();
2 changes: 1 addition & 1 deletion dist/socket.io.min.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions lib/transport.js
Expand Up @@ -217,9 +217,12 @@
self.open();
}, this.socket.options['reopen delay']);*/

this.isOpen = false;
this.socket.onClose();
this.onDisconnect();
/* only call close if transport hasn't been swapped out already */
if (this.socket.transport === this) {
this.isOpen = false;
this.socket.onClose();
this.onDisconnect();
}
};

/**
Expand Down