* Tear down method for the client's websocket instance. This method undoes the work in setupWebsocket(url).
()
| 576 | * Tear down method for the client's websocket instance. This method undoes the work in setupWebsocket(url). |
| 577 | */ |
| 578 | private teardownWebsocket(): void { |
| 579 | if (this.websocket !== undefined) { |
| 580 | this.websocket.removeAllListeners('open'); |
| 581 | this.websocket.removeAllListeners('close'); |
| 582 | this.websocket.removeAllListeners('error'); |
| 583 | this.websocket.removeAllListeners('message'); |
| 584 | this.websocket = undefined; |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | /** |
| 589 | * `onmessage` handler for the client's websocket. This will parse the payload and dispatch the relevant events for |