MCPcopy
hub / github.com/socketio/socket.io / _packet

Method _packet

packages/socket.io-client/lib/manager.ts:504–511  ·  view source on GitHub ↗

* Writes a packet. * * @param packet * @private

(packet: Partial<Packet & { query: string; options: any }>)

Source from the content-addressed store, hash-verified

502 * @private
503 */
504 _packet(packet: Partial<Packet & { query: string; options: any }>): void {
505 debug("writing packet %j", packet);
506
507 const encodedPackets = this.encoder.encode(packet as Packet);
508 for (let i = 0; i < encodedPackets.length; i++) {
509 this.engine.write(encodedPackets[i], packet.options);
510 }
511 }
512
513 /**
514 * Clean up transport subscriptions and packet buffer.

Callers 1

packetMethod · 0.45

Calls 3

debugFunction · 0.85
encodeMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected