MCPcopy Index your code
hub / github.com/nodejs/node / [kSetServersInternal]

Method [kSetServersInternal]

lib/internal/dns/utils.js:157–175  ·  view source on GitHub ↗
(newSet, servers)

Source from the content-addressed store, hash-verified

155 }
156
157 [kSetServersInternal](newSet, servers) {
158 const orig = ArrayPrototypeMap(this._handle.getServers() || [], (val) => {
159 val.unshift(isIP(val[0]));
160 return val;
161 });
162 const errorNumber = this._handle.setServers(newSet);
163
164 if (errorNumber !== 0) {
165 // Reset the servers to the old servers, because ares probably unset them.
166 this._handle.setServers(orig);
167 const { strerror } = lazyBinding();
168 const err = strerror(errorNumber);
169 throw new ERR_DNS_SET_SERVERS_FAILED(err, servers);
170 }
171
172 if (isBuildingSnapshot()) {
173 this[kSnapshotStates].servers = newSet;
174 }
175 }
176
177
178 setLocalAddress(ipv4, ipv6) {

Callers

nothing calls this directly

Calls 6

isIPFunction · 0.85
lazyBindingFunction · 0.85
isBuildingSnapshotFunction · 0.85
getServersMethod · 0.80
unshiftMethod · 0.80
setServersMethod · 0.80

Tested by

no test coverage detected