Skip to content
Snippets Groups Projects
Commit 1fa75081 authored by mcmlxxix's avatar mcmlxxix
Browse files

try this shit.. pingping fixes

parent d5d69964
No related branches found
No related tags found
No related merge requests found
......@@ -41,19 +41,25 @@ Socket.prototype.recvJSON = function() {
try {
packet=JSON.parse(packet,this.reviver);
if(packet.scope && packet.scope.toUpperCase() == "SOCKET") {
this.pingIn(packet);
this.pingOut("PONG");
packet = null;
this.process(packet);
}
}
catch(e) {
log(LOG_ERROR,e);
packet = null;
}
}
return packet;
};
Socket.prototype.process = function(packet) {
if(packet.func && packet.func.toUpperCase() == "PONG") {
this.pingIn(packet);
}
else if(packet.func && packet.func.toUpperCase() == "PING") {
this.pingOut("PONG");
}
}
/* ping pong */
Socket.prototype.pingOut = function(func) {
var ping={
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment