Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ipc.connectTo('klyng_beacon', function() {
ipc.of.klyng_beacon.emit('PROBE:MSG', {});
ipc.of.klyng_beacon.on('ALIVE:MSG', function() {
ipc.disconnect('klyng_beacon');
done();
});
});
}, 500);
ipc.connectToNet('iceworks', () => {
ipc.of.iceworks.on('connect', () => {
connected = true;
console.log('iceworks ipc 链接成功');
});
ipc.of.iceworks.on('disconnect', () => {
connected = false;
ipc.log('disconnected from iceworks');
});
});
}
const send = (command, data = {}) => {
const packet = { command, data };
ipc.of[hostname].emit('spawner.message', packet);
};
const emit_message = (msg, data)=>ipc.of.lum_node_index &&
ipc.of.lum_node_index.emit(msg, data);
function sendMessage(command, data) {
if (!data) {
data = {};
}
var packet = {
command: command,
data: data
};
ipc.of.cncserver.emit('app.message', packet);
}
ipc.connectTo(cypressWatcherId, function() {
ipc.of[cypressWatcherId].emit("message", "RESTART");
});
}
ipc.connectTo('lum_node_index', ()=>{
ipc.of.lum_node_index.on('connect', ()=>{
emit_message('upgrader_connected');
});
ipc.of.lum_node_index.on('stop', ()=>{
logger.notice('Stopping upgrader...');
E.shutdown();
});
ipc.of.lum_node_index.on('start_auto_upgrade', ()=>{
E.start_auto_upgrade();
});
ipc.of.lum_node_index.on('upgrade', (opt={})=>{
logger.notice('Upgrading proxy manager...');
E.upgrade(e=>{
if (!e)
logger.notice('Upgrade completed successfully');
emit_message('upgrade_finished', {error: e, cli: opt.cli});
});
ipc.connectToNet(this.serverName, this.host, this.port, function () {
ipc.of[this.serverName].on('connect', function () {
deferred.resolve('Connected to ', this.serverName);
}.bind(this));
}.bind(this));
}
function(){
ipc.log('## connected to main ##', ipc.config.delay);
channel = ipc.of.main;
}
);
ipc.connectTo(name, () => {
ipc.of[name].on('error', () => {
ipc.disconnect(name);
resolve(false);
});
ipc.of[name].on('connect', () => {
ipc.disconnect(name);
resolve(true);
});
});
});