diff --git a/exec/load/json-sock.js b/exec/load/json-sock.js
index 5b22ace6f7ab6b2d61d8d31d09a236919105b235..7ed514c56d54de98338e57b081d2f94bf9cc4d48 100644
--- a/exec/load/json-sock.js
+++ b/exec/load/json-sock.js
@@ -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={