Skip to content

Commit

Permalink
socket: rooms and flags are now hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Dec 24, 2012
1 parent dc17333 commit de8e746
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ Socket.prototype.emit = function(ev){

// access last argument to see if it's an ACK callback
if ('function' == typeof args[args.length - 1]) {
if (this.rooms || (this.flags && this.flags.broadcast)) {
throw new Error('Callbacks are not supported when broadcasting');
}

debug('emitting packet with ack id %d', this.nsp.ids);
this.acks[this.nsp.ids] = args.pop();
packet.id = this.nsp.ids++;
Expand Down

0 comments on commit de8e746

Please sign in to comment.