(data)
| 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) { |
no test coverage detected