mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
2e5188de92
PR-URL: https://github.com/nodejs/node/pull/12451 Ref: https://github.com/nodejs/node/issues/12376 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
21 lines
441 B
JavaScript
21 lines
441 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const cluster = require('cluster');
|
|
const net = require('net');
|
|
|
|
if (cluster.isMaster) {
|
|
cluster.fork().on('message', function(msg) {
|
|
if (msg === 'done') this.kill();
|
|
});
|
|
} else {
|
|
const server = net.createServer(common.mustNotCall());
|
|
server.listen(0, function() {
|
|
server.unref();
|
|
server.ref();
|
|
server.close(function() {
|
|
process.send('done');
|
|
});
|
|
});
|
|
}
|