MCPcopy Index your code
hub / github.com/socketio/socket.io / writeToEngine

Method writeToEngine

lib/client.ts:230–246  ·  view source on GitHub ↗
(
    encodedPackets: Array<string | Buffer>,
    opts: WriteOptions
  )

Source from the content-addressed store, hash-verified

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

Callers 2

_packetMethod · 0.95
patchAdapterFunction · 0.80

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected