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

Function checkSupportReusePort

test/common/udp.js:6–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4const options = { type: 'udp4', reusePort: true };
5
6function checkSupportReusePort() {
7 return new Promise((resolve, reject) => {
8 const socket = dgram.createSocket(options);
9 socket.bind(0);
10 socket.on('listening', () => {
11 socket.close(resolve);
12 });
13 socket.on('error', (err) => {
14 console.log('The `reusePort` option is not supported:', err.message);
15 socket.close();
16 reject(err);
17 });
18 });
19}
20
21module.exports = {
22 checkSupportReusePort,

Callers

nothing calls this directly

Calls 6

createSocketMethod · 0.80
closeMethod · 0.65
rejectFunction · 0.50
bindMethod · 0.45
onMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…