Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 27dada6

Browse files
author
Kevin Roark
committed
distinction between ACK and BINARY_ACK
1 parent 99f1ac9 commit 27dada6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/socket.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ Socket.prototype.onpacket = function(packet){
293293
this.onack(packet);
294294
break;
295295

296+
case parser.BINARY_ACK:
297+
this.onack(packet);
298+
break;
299+
296300
case parser.DISCONNECT:
297301
this.ondisconnect();
298302
break;
@@ -336,9 +340,11 @@ Socket.prototype.ack = function(id){
336340
if (sent) return;
337341
var args = Array.prototype.slice.call(arguments);
338342
debug('sending ack %j', args);
343+
344+
var type = hasBin(args) ? parser.BINARY_ACK : parser.ACK;
339345
self.packet({
340346
id: id,
341-
type: parser.ACK,
347+
type: type,
342348
data: args
343349
});
344350
};

0 commit comments

Comments
 (0)