* Tries to resolve the addresses for the host name.
()
| 603 | * Tries to resolve the addresses for the host name. |
| 604 | */ |
| 605 | async refresh() { |
| 606 | if (this._isIp) { |
| 607 | return; |
| 608 | } |
| 609 | |
| 610 | if (this._refreshing) { |
| 611 | return await promiseUtils.fromEvent(this._refreshing, 'finished'); |
| 612 | } |
| 613 | |
| 614 | this._refreshing = new EventEmitter().setMaxListeners(0); |
| 615 | |
| 616 | try { |
| 617 | await this._resolve(); |
| 618 | } catch (err) { |
| 619 | // Ignore the possible resolution error |
| 620 | } |
| 621 | |
| 622 | this._refreshing.emit('finished'); |
| 623 | this._refreshing = null; |
| 624 | } |
| 625 | |
| 626 | async _resolve() { |
| 627 | const arr = await this._resolve4(this._nameOrIp); |
no test coverage detected