Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More support for disconnections

  • Loading branch information...
commit ae9e550c26a883b3f4d264711639560dd747352e 1 parent b19bac2
@rauchg rauchg authored
View
4 lib/socket.io/client.js
@@ -36,8 +36,8 @@ this.Client = Class({
var self = this;
this.request = req;
this.response = res;
- this.connection = this.request.connection;
- if (this._disconnectTimeout) clearTimeout(this._disconnectTimeout);
+ this.connection = this.request.connection;
+ if (this._disconnectTimeout) clearTimeout(this._disconnectTimeout);
},
_payload: function(){
View
5 lib/socket.io/transports/htmlfile.js
@@ -4,16 +4,15 @@ var Client = require('../client').Client,
this['htmlfile'] = Client.extend({
_onConnect: function(req, res){
+ var self = this, body = '';
switch (req.method){
case 'GET':
- var self = this;
this.__super__(req, res);
-
+ this.request.connection.addListener('end', function(){ self._onClose(); });
this.response.useChunkedEncodingByDefault = false;
this.response.shouldKeepAlive = true;
this.response.writeHead(200, { 'Content-type': 'text/html' });
this.response.flush();
-
this._payload();
break;
View
3  lib/socket.io/transports/xhr-multipart.js
@@ -9,7 +9,7 @@ this['xhr-multipart'] = Client.extend({
case 'GET':
var self = this;
this.__super__(req, res);
-
+ this.request.connection.addListener('end', function(){ self._onClose(); });
this.response.useChunkedEncodingByDefault = false;
this.response.shouldKeepAlive = true;
this.response.writeHead(200, {
@@ -18,7 +18,6 @@ this['xhr-multipart'] = Client.extend({
});
this.response.write("--socketio\n");
this.response.flush();
-
this._payload();
break;
View
2  lib/socket.io/transports/xhr-polling.js
@@ -9,7 +9,7 @@ this['xhr-polling'] = Client.extend({
},
_onConnect: function(req, res){
- var self = this;
+ var self = this, body = '';
switch (req.method){
case 'GET':
this.__super__(req, res);
Please sign in to comment.
Something went wrong with that request. Please try again.