(fn: () => Promise<T>)
| 403 | } |
| 404 | |
| 405 | async quit<T>(fn: () => Promise<T>): Promise<T> { |
| 406 | if (!this.#isOpen) { |
| 407 | throw new ClientClosedError(); |
| 408 | } |
| 409 | |
| 410 | this.#isOpen = false; |
| 411 | const reply = await fn(); |
| 412 | this.destroySocket(); |
| 413 | return reply; |
| 414 | } |
| 415 | |
| 416 | close() { |
| 417 | if (!this.#isOpen) { |
no test coverage detected