* Immediately closes the session, all pending * message callbacks will be called with an * error. * @returns {void}
()
| 146 | * @returns {void} |
| 147 | */ |
| 148 | disconnect() { |
| 149 | if (!this.#connection) |
| 150 | return; |
| 151 | this.#connection.disconnect(); |
| 152 | this.#connection = null; |
| 153 | const remainingCallbacks = this.#messageCallbacks.values(); |
| 154 | for (const callback of remainingCallbacks) { |
| 155 | process.nextTick(callback, new ERR_INSPECTOR_CLOSED()); |
| 156 | } |
| 157 | this.#messageCallbacks.clear(); |
| 158 | this.#nextId = 1; |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | /** |