acks: automatic for .send and manual for .emit

This commit is contained in:
Vladimir Dronnikov
2011-06-29 08:33:08 -07:00
parent 27be7ac6e3
commit 8ce05bc68c

View File

@@ -1,4 +1,3 @@
/**
* socket.io
* Copyright(c) 2011 LearnBoost <dev@learnboost.com>
@@ -70,7 +69,7 @@
if ('function' == typeof fn) {
packet.id = ++this.ackPackets;
packet.ack = fn.length ? 'data' : true;
packet.ack = true;
this.acks[packet.id] = fn;
}
@@ -93,7 +92,7 @@
if ('function' == typeof lastArg) {
packet.id = ++this.ackPackets;
packet.ack = lastArg.length ? 'data' : true;
packet.ack = 'data';
this.acks[packet.id] = lastArg;
args = args.slice(0, args.length - 1);
}