socket: fixed packet handling

This commit is contained in:
Guillermo Rauch
2012-12-18 15:15:12 -03:00
parent 169046e026
commit 56ed3fbe75

View File

@@ -186,19 +186,19 @@ Socket.prototype.onconnect = function(){
Socket.prototype.onpacket = function(packet){
debug('got packet %j', packet);
switch (packet.type) {
case packet.EVENT:
case parser.EVENT:
this.onevent(packet);
break;
case packet.ACK:
case parser.ACK:
this.onack(packet);
break;
case packet.DISCONNECT:
case parser.DISCONNECT:
this.ondisconnect();
break;
case packet.ERROR:
case parser.ERROR:
this.emit('error', packet.data);
}
};