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

Method encodeAsBinary

packages/socket.io-parser/lib/index.ts:124–131  ·  view source on GitHub ↗

* Encode packet as 'buffer sequence' by removing blobs, and * deconstructing packet into object with placeholders and * a list of buffers.

(obj: Packet)

Source from the content-addressed store, hash-verified

122 */
123
124 private encodeAsBinary(obj: Packet) {
125 const deconstruction = deconstructPacket(obj);
126 const pack = this.encodeAsString(deconstruction.packet);
127 const buffers = deconstruction.buffers;
128
129 buffers.unshift(pack); // add packet info to beginning of data list
130 return buffers; // write all the buffers
131 }
132}
133
134interface DecoderReservedEvents {

Callers 1

encodeMethod · 0.95

Calls 2

encodeAsStringMethod · 0.95
deconstructPacketFunction · 0.90

Tested by

no test coverage detected