Implement 'pong' command to hybi.js

This commit is contained in:
Victor Gama
2015-02-20 21:33:07 -02:00
committed by James Coglan
parent 1cc0f33e1c
commit 309b5651a7
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -96,6 +96,10 @@ var instance = {
return false;
},
pong: function() {
return false;
},
close: function(reason, code) {
if (this.readyState !== 1) return false;
this.readyState = 3;
+5
View File
@@ -169,6 +169,11 @@ var instance = {
return this.frame(message, 'ping');
},
pong: function(message) {
if (this.readyState > 1) return false;
return this.frame(message, 'pong');
},
close: function(reason, code) {
reason = reason || '';
code = code || this.ERRORS.normal_closure;