()
| 532 | const messageHandler = (raw: unknown, isBinary: boolean): void => |
| 533 | this.onWsMessage(ws, raw, isBinary); |
| 534 | const closeHandler = (): void => { |
| 535 | if (this.ws === ws) this.detach(); |
| 536 | }; |
| 537 | const errorHandler = closeHandler; |
| 538 | ws.on('message', messageHandler); |
| 539 | ws.on('close', closeHandler); |