mirror of
https://github.com/nodejs/node.git
synced 2025-05-01 17:03:34 +00:00

In the tests, we use "process.platform === 'win32'" in some places. This patch replaces them with the "common.isWindows" for consistency. PR-URL: https://github.com/nodejs/io.js/pull/2269 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
31 lines
619 B
JavaScript
31 lines
619 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
if (common.isWindows) {
|
|
console.log('1..0 # Skipped: on windows, because clustered dgram is ENOTSUP');
|
|
return;
|
|
}
|
|
|
|
var cluster = require('cluster');
|
|
var dgram = require('dgram');
|
|
|
|
if (cluster.isMaster) {
|
|
var unbound = cluster.fork().on('online', bind);
|
|
|
|
function bind() {
|
|
cluster.fork({BOUND: 'y'}).on('listening', disconnect);
|
|
}
|
|
|
|
function disconnect() {
|
|
unbound.disconnect();
|
|
unbound.on('disconnect', cluster.disconnect);
|
|
}
|
|
} else {
|
|
if (process.env.BOUND === 'y') {
|
|
var source = dgram.createSocket('udp4');
|
|
|
|
source.bind(0);
|
|
}
|
|
}
|