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

Function ping

test/sequential/test-inspector-open-dispose.mjs:51–60  ·  view source on GitHub ↗
(port, callback)

Source from the content-addressed store, hash-verified

49}
50
51function ping(port, callback) {
52 net.connect({ port, family: 4 })
53 .on('connect', function() { close(this); })
54 .on('error', function(err) { close(this, err); });
55
56 function close(self, err) {
57 self.end();
58 self.on('close', () => callback(err));
59 }
60}
61
62async function beChild() {
63 const inspector = await import('node:inspector');

Callers 2

wasOpenedHandlerFunction · 0.70

Calls 3

closeFunction · 0.70
connectMethod · 0.65
onMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…