mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
567 B
25 lines
567 B
13 years ago
|
var common = require('../common');
|
||
|
var assert = require('assert');
|
||
|
var fork = require('child_process').fork;
|
||
|
|
||
|
if (process.argv[2] === 'child') {
|
||
|
console.log('child -> call disconnect');
|
||
|
process.disconnect();
|
||
|
|
||
|
setTimeout(function() {
|
||
|
console.log('child -> will this keep it alive?');
|
||
|
process.on('message', function () { });
|
||
|
}, 400);
|
||
|
|
||
|
} else {
|
||
|
var child = fork(__filename, ['child']);
|
||
|
|
||
|
child.on('disconnect', function () {
|
||
|
console.log('parent -> disconnect');
|
||
|
});
|
||
|
|
||
|
child.once('exit', function () {
|
||
|
console.log('parent -> exit');
|
||
|
});
|
||
|
}
|