MCPcopy Index your code
hub / github.com/nodejs/node / createLookupServicePromise

Function createLookupServicePromise

lib/internal/dns/promises.js:254–279  ·  view source on GitHub ↗
(hostname, port)

Source from the content-addressed store, hash-verified

252}
253
254function createLookupServicePromise(hostname, port) {
255 return new Promise((resolve, reject) => {
256 const req = new GetNameInfoReqWrap();
257
258 req.hostname = hostname;
259 req.port = port;
260 req.oncomplete = onlookupservice;
261 req.resolve = resolve;
262 req.reject = reject;
263
264 const err = getnameinfo(req, hostname, port);
265
266 if (err)
267 reject(new DNSException(err, 'getnameinfo', hostname));
268 else if (hasObserver('dns')) {
269 startPerf(req, kPerfHooksDnsLookupServiceContext, {
270 type: 'dns',
271 name: 'lookupService',
272 detail: {
273 host: hostname,
274 port,
275 },
276 });
277 }
278 });
279}
280
281function lookupService(address, port) {
282 if (arguments.length !== 2)

Callers 1

lookupServiceFunction · 0.85

Calls 3

hasObserverFunction · 0.85
startPerfFunction · 0.85
rejectFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…