mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
84fe809535
Unhandled `'error'` events will make the process exit with an unclean exit code anyway. PR-URL: https://github.com/nodejs/node/pull/55486 Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
20 lines
542 B
JavaScript
20 lines
542 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const { checkSupportReusePort, options } = require('../common/udp');
|
|
const dgram = require('dgram');
|
|
|
|
function test() {
|
|
const socket1 = dgram.createSocket(options);
|
|
const socket2 = dgram.createSocket(options);
|
|
socket1.bind(0, common.mustCall(() => {
|
|
socket2.bind(socket1.address().port, common.mustCall(() => {
|
|
socket1.close();
|
|
socket2.close();
|
|
}));
|
|
}));
|
|
}
|
|
|
|
checkSupportReusePort().then(test, () => {
|
|
common.skip('The `reusePort` option is not supported');
|
|
});
|