Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions dist/socket.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);

util.request = function (xdomain) {

if (xdomain && 'undefined' != typeof XDomainRequest) {
if (xdomain && 'undefined' != typeof XDomainRequest && !util.ua.hasCORS) {
return new XDomainRequest();
}

Expand Down Expand Up @@ -318,7 +318,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
*
* @api public
*/

util.merge = function merge (target, additional, deep, lastseen) {
var seen = lastseen || []
, depth = typeof deep == 'undefined' ? 2 : deep
Expand All @@ -343,7 +343,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
*
* @api public
*/

util.mixin = function (ctor, ctor2) {
util.merge(ctor.prototype, ctor2.prototype);
};
Expand Down Expand Up @@ -391,7 +391,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
}

return ret;
}
};

/**
* Array indexOf compatibility.
Expand All @@ -401,8 +401,8 @@ var io = ('undefined' === typeof module ? {} : module.exports);
*/

util.indexOf = function (arr, o, i) {
for (var j = arr.length, i = i < 0 ? i + j < 0 ? 0 : i + j : i || 0;

for (var j = arr.length, i = i < 0 ? i + j < 0 ? 0 : i + j : i || 0;
i < j && arr[i] !== o; i++) {}

return j <= i ? -1 : i;
Expand Down Expand Up @@ -667,7 +667,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
return exports.JSON = {
parse: nativeJSON.parse
, stringify: nativeJSON.stringify
}
};
}

var JSON = exports.JSON = {};
Expand Down Expand Up @@ -1273,7 +1273,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);

Transport.prototype.heartbeats = function () {
return true;
}
};

/**
* Handles the response from the server. When a new response is received
Expand All @@ -1286,8 +1286,8 @@ var io = ('undefined' === typeof module ? {} : module.exports);

Transport.prototype.onData = function (data) {
this.clearCloseTimeout();
// If the connection in currently open (or in a reopening state) reset the close

// If the connection in currently open (or in a reopening state) reset the close
// timeout since we have just received data. This check is necessary so
// that we don't reset the timeout on an explicitly disconnected connection.
if (this.socket.connected || this.socket.connecting || this.socket.reconnecting) {
Expand Down Expand Up @@ -1339,7 +1339,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
*
* @api private
*/

Transport.prototype.setCloseTimeout = function () {
if (!this.closeTimeout) {
var self = this;
Expand Down Expand Up @@ -1372,7 +1372,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
Transport.prototype.onConnect = function () {
this.socket.onConnect();
return this;
}
};

/**
* Clears close timeout
Expand Down Expand Up @@ -1423,7 +1423,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
Transport.prototype.onHeartbeat = function (heartbeat) {
this.packet({ type: 'heartbeat' });
};

/**
* Called when the transport opens.
*
Expand Down Expand Up @@ -1524,6 +1524,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
, 'reopen delay': 3000
, 'max reconnection attempts': 10
, 'sync disconnect on unload': false
, 'sync disconnect timeout': 0
, 'auto connect': true
, 'flash policy port': 10843
, 'manualFlush': false
Expand Down Expand Up @@ -1858,6 +1859,7 @@ var io = ('undefined' === typeof module ? {} : module.exports);
].join('/') + '/?disconnect=1';

xhr.open('GET', uri, false);
xhr.timeout = this.options['sync disconnect timeout'];
xhr.send(null);

// handle disconnection immediately
Expand Down Expand Up @@ -3751,7 +3753,7 @@ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="Sho

this.socket.setBuffer(true);
};

/**
* Creates a new JSONP poll that can be used to listen
* for messages from the Socket.IO server.
Expand All @@ -3778,7 +3780,7 @@ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="Sho
self.onClose();
};

var insertAt = document.getElementsByTagName('script')[0]
var insertAt = document.getElementsByTagName('script')[0];
insertAt.parentNode.insertBefore(script, insertAt);
this.script = script;

Expand Down Expand Up @@ -3859,4 +3861,7 @@ var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="Sho
, this
);

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.

2 changes: 2 additions & 0 deletions lib/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
, 'reopen delay': 3000
, 'max reconnection attempts': 10
, 'sync disconnect on unload': false
, 'sync disconnect timeout': 0
, 'auto connect': true
, 'flash policy port': 10843
, 'manualFlush': false
Expand Down Expand Up @@ -368,6 +369,7 @@
].join('/') + '/?disconnect=1';

xhr.open('GET', uri, false);
xhr.timeout = this.options['sync disconnect timeout'];
xhr.send(null);

// handle disconnection immediately
Expand Down