()
| 65 | } |
| 66 | |
| 67 | clean() { |
| 68 | if (this.options.ws && this.options.ws.readyState === WebSocket.OPEN) { |
| 69 | this.options.ws.close() |
| 70 | } |
| 71 | this.options.ws.onopen = this.options.ws.onclose = this.options.ws.onmessage = this.options.ws.onerror = undefined as any; |
| 72 | |
| 73 | super.clean(); |
| 74 | this.logger.destroy(); |
| 75 | this.ip = this.session = this.logger = undefined as any; |
| 76 | } |
| 77 | |
| 78 | destroy() { |
| 79 | WsConnection.pool.put(this); |