2016-03-28 21:00:41 +00:00
|
|
|
const path = require('path')
|
|
|
|
|
2016-03-25 20:03:49 +00:00
|
|
|
process.on('uncaughtException', function (error) {
|
|
|
|
process.send(error.stack)
|
|
|
|
})
|
2013-09-05 01:21:39 +00:00
|
|
|
|
2016-03-28 21:00:41 +00:00
|
|
|
var child = require('child_process').fork(path.join(__dirname, '/ping.js'))
|
2016-03-25 20:03:49 +00:00
|
|
|
process.on('message', function (msg) {
|
|
|
|
child.send(msg)
|
|
|
|
})
|
2013-09-05 01:21:39 +00:00
|
|
|
child.on('message', function (msg) {
|
2016-03-25 20:03:49 +00:00
|
|
|
process.send(msg)
|
|
|
|
})
|
|
|
|
child.on('exit', function (code) {
|
|
|
|
process.exit(code)
|
|
|
|
})
|