onack method

void onack(
  1. Map packet
)

Called upon a server acknowlegement.

@param {Object} packet @api private

Implementation

void onack(Map packet) {
  var ack = acks.remove(packet['id']);
  if (ack is Function) {
    _logger.fine('''calling ack ${packet['id']} with ${packet['data']}''');

    var args = packet['data'] as List;
    if (args.length > 1) {
      // Fix for #42 with nodejs server
      Function.apply(ack, [args]);
    } else {
      Function.apply(ack, args);
    }
  } else {
    _logger.fine('''bad ack ${packet['id']}''');
  }
}