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