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

Function callback

packages/socket.io/client-dist/socket.io.js:981–995  ·  view source on GitHub ↗
(packet)

Source from the content-addressed store, hash-verified

979 _proto.onData = function onData(data) {
980 var _this3 = this;
981 var callback = function callback(packet) {
982 // if its the first message we consider the transport open
983 if ("opening" === _this3.readyState && packet.type === "open") {
984 _this3.onOpen();
985 }
986 // if its a close packet, we close the ongoing requests
987 if ("close" === packet.type) {
988 _this3.onClose({
989 description: "transport closed by the server"
990 });
991 return false;
992 }
993 // otherwise bypass onData and handle the message
994 _this3.onPacket(packet);
995 };
996 // decode payload
997 decodePayload(data, this.socket.binaryType).forEach(callback);
998 // if an event did not trigger closing

Callers 7

encodePacketFunction · 0.70
encodeBlobAsBase64Function · 0.70
encodePacketToBinaryFunction · 0.70
encodePayloadFunction · 0.70
handshake.tsFile · 0.50
todo.handlers.jsFile · 0.50
todo.handlers.tsFile · 0.50

Calls 3

onOpenMethod · 0.45
onCloseMethod · 0.45
onPacketMethod · 0.45

Tested by

no test coverage detected