()
| 112 | } |
| 113 | |
| 114 | async _poll(): Promise<void> { |
| 115 | const generation = this.generation; |
| 116 | let srvRecords; |
| 117 | |
| 118 | try { |
| 119 | srvRecords = await dns.promises.resolve(this.srvAddress, 'SRV'); |
| 120 | } catch { |
| 121 | this.failure(); |
| 122 | return; |
| 123 | } |
| 124 | |
| 125 | if (generation !== this.generation) { |
| 126 | return; |
| 127 | } |
| 128 | |
| 129 | const finalAddresses: dns.SrvRecord[] = []; |
| 130 | for (const record of srvRecords) { |
| 131 | try { |
| 132 | checkParentDomainMatch(record.name, this.srvHost); |
| 133 | finalAddresses.push(record); |
| 134 | } catch (error) { |
| 135 | squashError(error); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | if (!finalAddresses.length) { |
| 140 | this.failure(); |
| 141 | return; |
| 142 | } |
| 143 | |
| 144 | this.success(finalAddresses); |
| 145 | } |
| 146 | } |
no test coverage detected