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

Method writeToEngine

packages/socket.io/lib/client.ts:231–247  ·  view source on GitHub ↗
(
    encodedPackets: Array<string | Buffer>,
    opts: WriteOptions,
  )

Source from the content-addressed store, hash-verified

229 }
230
231 private writeToEngine(
232 encodedPackets: Array<string | Buffer>,
233 opts: WriteOptions,
234 ): void {
235 if (opts.volatile && !this.conn.transport.writable) {
236 debug(
237 "volatile packet is discarded since the transport is not currently writable",
238 );
239 return;
240 }
241 const packets = Array.isArray(encodedPackets)
242 ? encodedPackets
243 : [encodedPackets];
244 for (const encodedPacket of packets) {
245 this.conn.write(encodedPacket, opts);
246 }
247 }
248
249 /**
250 * Called with incoming transport data.

Callers 4

_packetMethod · 0.95
broadcastMethod · 0.80
broadcastWithAckMethod · 0.80
patchAdapterFunction · 0.80

Calls 2

debugFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected