Skip to content

Instantly share code, notes, and snippets.

@myndzi
Created January 24, 2019 07:25
Show Gist options
  • Save myndzi/69bc5748d98b84f0afc7fd3051ac3167 to your computer and use it in GitHub Desktop.
Save myndzi/69bc5748d98b84f0afc7fd3051ac3167 to your computer and use it in GitHub Desktop.
function(){
// prevent double callbacks
if (sent) return;
var args = Array.prototype.slice.call(arguments);
debug('sending ack %j', args);
self.packet({
id: id,
type: hasBin(args) ? parser.BINARY_ACK : parser.ACK,
data: args
});
sent = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment