Skip to content

Commit

Permalink
Implemented heartbeats
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillermo Rauch committed Jun 26, 2010
1 parent 5e32922 commit 57c8d37
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/socket.io/transports/websocket.js
Expand Up @@ -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){
Expand Down

0 comments on commit 57c8d37

Please sign in to comment.