MCPcopy
hub / github.com/socketio/socket.io / #onOpen

Method #onOpen

examples/basic-websocket-client/src/index.js:114–124  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

112 }
113
114 #onOpen(data) {
115 let handshake;
116 try {
117 handshake = JSON.parse(data.substring(1));
118 } catch (e) {
119 return this.#onClose("parse error");
120 }
121 this.#pingTimeoutDelay = handshake.pingInterval + handshake.pingTimeout;
122 this.#resetPingTimeout();
123 this.#doConnect();
124 }
125
126 #onPacket(packet) {
127 switch (packet.type) {

Callers 1

#onMessageMethod · 0.95

Calls 3

#onCloseMethod · 0.95
#resetPingTimeoutMethod · 0.95
#doConnectMethod · 0.95

Tested by

no test coverage detected