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

Method onData

packages/engine.io/lib/transports-uws/polling.ts:221–238  ·  view source on GitHub ↗

* Processes the incoming data payload. * * @param {String} encoded payload * @private

(data)

Source from the content-addressed store, hash-verified

219 * @private
220 */
221 onData(data) {
222 debug('received "%s"', data);
223 const callback = (packet) => {
224 if ("close" === packet.type) {
225 debug("got xhr close packet");
226 this.onClose();
227 return false;
228 }
229
230 this.onPacket(packet);
231 };
232
233 if (this.protocol === 3) {
234 (this.parser as typeof parser_v3).decodePayload(data, callback);
235 } else {
236 (this.parser as typeof parser_v4).decodePayload(data).forEach(callback);
237 }
238 }
239
240 /**
241 * Overrides onClose.

Callers 2

onEndMethod · 0.95
onDataRequestMethod · 0.45

Calls 1

debugFunction · 0.85

Tested by

no test coverage detected