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

Function callback

client-dist/socket.io.js:1188–1202  ·  view source on GitHub ↗
(packet)

Source from the content-addressed store, hash-verified

1186 value: function onData(data) {
1187 var _this3 = this;
1188 var callback = function callback(packet) {
1189 // if its the first message we consider the transport open
1190 if ("opening" === _this3.readyState && packet.type === "open") {
1191 _this3.onOpen();
1192 }
1193 // if its a close packet, we close the ongoing requests
1194 if ("close" === packet.type) {
1195 _this3.onClose({
1196 description: "transport closed by the server"
1197 });
1198 return false;
1199 }
1200 // otherwise bypass onData and handle the message
1201 _this3.onPacket(packet);
1202 };
1203 // decode payload
1204 decodePayload(data, this.socket.binaryType).forEach(callback);
1205 // if an event did not trigger closing

Callers 7

handshake.tsFile · 0.85
todo.handlers.jsFile · 0.85
todo.handlers.tsFile · 0.85
encodePacketFunction · 0.85
encodeBlobAsBase64Function · 0.85
encodePacketToBinaryFunction · 0.85
encodePayloadFunction · 0.85

Calls 3

onOpenMethod · 0.45
onCloseMethod · 0.45
onPacketMethod · 0.45

Tested by

no test coverage detected