36 lines
525 B
JavaScript
36 lines
525 B
JavaScript
|
import ipc from '../../node-ipc.js';
|
||
|
import process from 'process';
|
||
|
|
||
|
const dieAfter = 30e3;
|
||
|
|
||
|
function killClientProcess(){
|
||
|
process.exit(0);
|
||
|
}
|
||
|
|
||
|
|
||
|
setTimeout(
|
||
|
killClientProcess,
|
||
|
dieAfter
|
||
|
);
|
||
|
|
||
|
ipc.config.id = 'tcpClient';
|
||
|
ipc.config.retry= 600;
|
||
|
ipc.config.silent=true;
|
||
|
ipc.config.networkPort=8500;
|
||
|
|
||
|
|
||
|
ipc.connectToNet('tcpClient');
|
||
|
|
||
|
ipc.of.tcpClient.on(
|
||
|
'message',
|
||
|
function(data){
|
||
|
if(data.type=='END'){
|
||
|
killClientProcess();
|
||
|
}
|
||
|
}
|
||
|
)
|
||
|
|
||
|
export {
|
||
|
dieAfter as default,
|
||
|
dieAfter
|
||
|
}
|