packet method

void packet(
  1. dynamic packet, [
  2. dynamic opts
])

Writes a packet.

@param {Object} packet object @param {Object} options @api private

Implementation

void packet(packet, [opts]) {
  if (packet is Map) {
    packet['nsp'] = nsp.name;
  }
  opts = opts ?? {};
  opts['compress'] = false != opts['compress'];
  client.packet(packet, opts);
}