mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
6d49f46b48
PR-URL: https://github.com/nodejs/node/pull/46041 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
24 lines
617 B
JavaScript
24 lines
617 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const dgram = require('dgram');
|
|
const cluster = require('cluster');
|
|
const assert = require('assert');
|
|
|
|
if (common.isWindows)
|
|
common.skip('dgram clustering is currently not supported on Windows.');
|
|
|
|
if (cluster.isPrimary) {
|
|
cluster.fork();
|
|
} else {
|
|
const socket = dgram.createSocket('udp4');
|
|
socket.unref();
|
|
socket.bind();
|
|
socket.on('listening', common.mustCall(() => {
|
|
const sockets = process.getActiveResourcesInfo().filter((item) => {
|
|
return item === 'UDPWrap';
|
|
});
|
|
assert.ok(sockets.length === 0);
|
|
process.disconnect();
|
|
}));
|
|
}
|