(options)
| 24 | #onResolved; |
| 25 | #onError; |
| 26 | constructor(options) { |
| 27 | this.#onResolved = options.onResolved; |
| 28 | this.#onError = options.onError; |
| 29 | Net._resolve(options.host, (host, address) => { |
| 30 | if (address) |
| 31 | this.#onResolved?.(address); |
| 32 | else |
| 33 | this.#onError?.(); |
| 34 | }); |
| 35 | |
| 36 | this.target ??= options.target; |
| 37 | } |
| 38 | close() { |
| 39 | this.#onResolved = undefined; |
| 40 | this.#onError = undefined; |