mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-12 00:17:56 -05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57c8d37d47 | ||
|
|
5e329229b4 | ||
|
|
ea36d24d9e |
@@ -17,11 +17,11 @@ exports.htmlfile = Client.extend({
|
||||
'Transfer-Encoding': 'chunked'
|
||||
});
|
||||
this.response.write('<html><body>' + new Array(244).join(' '));
|
||||
this.response.flush();
|
||||
if ('flush' in this.response) this.response.flush();
|
||||
this._payload();
|
||||
this._heartbeatInterval = setInterval(function(){
|
||||
self.response.write('<!-- heartbeat -->');
|
||||
self.response.flush();
|
||||
if ('flush' in self.response) self.response.flush();
|
||||
}, this.options.heartbeatInterval);
|
||||
break;
|
||||
|
||||
@@ -44,7 +44,7 @@ exports.htmlfile = Client.extend({
|
||||
|
||||
_write: function(message){
|
||||
this.response.write('<script>parent.s._('+ message +', document);</script>');
|
||||
this.response.flush();
|
||||
if ('flush' in this.response) this.response.flush();
|
||||
}
|
||||
|
||||
});
|
||||
@@ -37,9 +37,14 @@ exports.websocket = Client.extend({
|
||||
this.connection.write(headers.concat('', '').join('\r\n'));
|
||||
this.connection.addListener('end', function(){ self._onClose(); });
|
||||
this.connection.addListener('data', function(data){ self._handle(data); });
|
||||
if (this._proveReception()) {
|
||||
|
||||
if (this._proveReception()){
|
||||
this._payload();
|
||||
}
|
||||
|
||||
setInterval(function(){
|
||||
self._write(JSON.stringify({heartbeat: '1'}));
|
||||
}, 10000);
|
||||
},
|
||||
|
||||
_handle: function(data){
|
||||
|
||||
Submodule test/client updated: d643e6029c...fec3a888e0
Reference in New Issue
Block a user