Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Implemented heartbeats

  • Loading branch information...
commit 57c8d37d47f3b7c698fdf657a9cc3b7dee646e69 1 parent 5e32922
Guillermo Rauch authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/socket.io/transports/websocket.js
View
7 lib/socket.io/transports/websocket.js
@@ -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){
Please sign in to comment.
Something went wrong with that request. Please try again.