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

Function callback

packages/engine.io-client/lib/transports/polling.ts:84–98  ·  view source on GitHub ↗
(packet)

Source from the content-addressed store, hash-verified

82 override onData(data) {
83 debug("polling got data %s", data);
84 const callback = (packet) => {
85 // if its the first message we consider the transport open
86 if ("opening" === this.readyState && packet.type === "open") {
87 this.onOpen();
88 }
89
90 // if its a close packet, we close the ongoing requests
91 if ("close" === packet.type) {
92 this.onClose({ description: "transport closed by the server" });
93 return false;
94 }
95
96 // otherwise bypass onData and handle the message
97 this.onPacket(packet);
98 };
99
100 // decode payload
101 decodePayload(data, this.socket.binaryType).forEach(callback);

Callers 15

doWriteMethod · 0.70
encodePayloadFunction · 0.50
encodePacketFunction · 0.50
encodeBlobAsBase64Function · 0.50
encodePacketToBinaryFunction · 0.50
encodePacketFunction · 0.50
encodePacketToBinaryFunction · 0.50
_applyMiddlewaresMethod · 0.50
handleRequestMethod · 0.50
handleUpgradeMethod · 0.50
_applyMiddlewaresFunction · 0.50
applyFunction · 0.50

Calls 3

onOpenMethod · 0.45
onCloseMethod · 0.45
onPacketMethod · 0.45

Tested by

no test coverage detected