mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
socket: turn acks into an object
This commit is contained in:
@@ -45,7 +45,7 @@ function Socket(io, nsp){
|
||||
this.nsp = nsp;
|
||||
this.json = this; // compat
|
||||
this.ids = 0;
|
||||
this.acks = [];
|
||||
this.acks = {};
|
||||
this.open();
|
||||
}
|
||||
|
||||
@@ -104,8 +104,8 @@ Socket.prototype.emit = function(ev){
|
||||
// event ack callback
|
||||
if ('function' == typeof args[args.length - 1]) {
|
||||
debug('emitting packet with ack id %d', this.ids);
|
||||
this.acks[this.ids] = args.pop();
|
||||
packet.id = this.ids++;
|
||||
this.acks.push(args.pop());
|
||||
}
|
||||
|
||||
packet.args = args;
|
||||
|
||||
Reference in New Issue
Block a user