mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
socket: fixed packet handling
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user