Skip to content

Commit

Permalink
Revert "websocket:Improve send method"
Browse files Browse the repository at this point in the history
This reverts commit 60c61af.
  • Loading branch information
rauchg committed Jun 7, 2013
1 parent 32b04b6 commit 8687ea4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/transports/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ WebSocket.prototype.onData = function (data) {
* @param {Array} packets
* @api private
*/
var isIOS = 'undefined' != typeof navigator
&& /iPad|iPhone|iPod/i.test(navigator.userAgent)
var isIOS;
WebSocket.prototype.send = function (data){
function send(packets){
for (var i = 0, l = packets.length; i < l; i++) {
Expand All @@ -97,7 +96,11 @@ WebSocket.prototype.send = function (data){
});
}
}
// see https://github.com/LearnBoost/socket.io-client/pull/426
// Due to a bug in the current iOS browser, we need to wrap the send in a
// setTimeout, when they resume from sleeping the browser will crash if
// we don't allow the browser time to detect the socket has been closed
isIOS = (isIOS !== undefined) ? isIOS : 'undefined' != typeof navigator
&& /iPad|iPhone|iPod/i.test(navigator.userAgent)
if (isIOS) {
var self = this;
setTimeout(function() {
Expand Down

0 comments on commit 8687ea4

Please sign in to comment.