Skip to content

Commit

Permalink
acks: automatic for .send and manual for .emit
Browse files Browse the repository at this point in the history
  • Loading branch information
dvv committed Jun 29, 2011
1 parent 27be7ac commit 8ce05bc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/namespace.js
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,3 @@

/** /**
* socket.io * socket.io
* Copyright(c) 2011 LearnBoost <dev@learnboost.com> * Copyright(c) 2011 LearnBoost <dev@learnboost.com>
Expand Down Expand Up @@ -70,7 +69,7 @@


if ('function' == typeof fn) { if ('function' == typeof fn) {
packet.id = ++this.ackPackets; packet.id = ++this.ackPackets;
packet.ack = fn.length ? 'data' : true; packet.ack = true;
this.acks[packet.id] = fn; this.acks[packet.id] = fn;
} }


Expand All @@ -93,7 +92,7 @@


if ('function' == typeof lastArg) { if ('function' == typeof lastArg) {
packet.id = ++this.ackPackets; packet.id = ++this.ackPackets;
packet.ack = lastArg.length ? 'data' : true; packet.ack = 'data';
this.acks[packet.id] = lastArg; this.acks[packet.id] = lastArg;
args = args.slice(0, args.length - 1); args = args.slice(0, args.length - 1);
} }
Expand Down

0 comments on commit 8ce05bc

Please sign in to comment.