node-ipc/test/TCP/TCPClient.js
2021-07-02 14:35:02 -07:00

36 lines
No EOL
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
}