(callback: (cause: unknown) => void)
| 63 | } |
| 64 | |
| 65 | connect(callback: (cause: unknown) => void) { |
| 66 | // Resume acquisition, then emit in the same driver turn, before a forked |
| 67 | // pool listener can run. Do not install a test-only error listener. |
| 68 | Fiber.getCurrent()!.currentDispatcher.scheduleTask(() => { |
| 69 | callback(null) |
| 70 | if (state.errorAfterConnect) { |
| 71 | state.errorAfterConnect = false |
| 72 | this.closed = true |
| 73 | try { |
| 74 | this.emit("error", new Error("Connection lost - read ETIMEDOUT")) |
| 75 | } catch (error) { |
| 76 | state.emissionError = error |
| 77 | } |
| 78 | } |
| 79 | }, 0) |
| 80 | } |
| 81 | |
| 82 | close() { |
| 83 | if (!this.closed) { |
nothing calls this directly
no test coverage detected