import cluster from 'node:cluster'; import dgram from 'node:dgram';
if (cluster.isPrimary) { cluster.fork(); // Works ok. cluster.fork(); // Fails with EADDRINUSE. } else { const s = dgram.createSocket('udp4'); s.bind(1234, () => { s.addMembership('224.0.0.114'); }); }