How to use the node-ipc.klyngRemote function in node-ipc

To help you get started, we’ve selected a few node-ipc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Mostafa-Samir / klyng / lib / job-manager.js View on Github external
setTimeout(() => {
         // disconnect from all remote beacon
         console.log();
         for(var socketId in ipc.klyngRemote.of) {
             ipc.klyngRemote.disconnect(socketId);
         }
         router.clear();
     }, 1000);
 }
github Mostafa-Samir / klyng / lib / job-manager.js View on Github external
setTimeout(() => {
         // disconnect from all remote beacon
         console.log();
         for(var socketId in ipc.klyngRemote.of) {
             ipc.klyngRemote.disconnect(socketId);
         }
         router.clear();
     }, 1000);
 }
github Mostafa-Samir / klyng / lib / tcp.js View on Github external
var ipc = require('node-ipc');
var cs = require('./crypto-service');
var configs = require('./beacon-configs');
var router = require('./router');
var jobman = require('./job-manager');

var remoteIPC = new ipc.IPC();
configs.configureRemoteIPC(remoteIPC);
ipc.klyngRemote = remoteIPC;


/*
 * connects to a remote beacon via ip:port
 * @param ip {String}
 * @param port {Number}
 * @return {Promise}: promise of the connection to be made
 */
function connectTo(ip, port) {
    return new Promise(function(resolve, reject) {
        var id = "sock_" + ip + ":" + port;

        remoteIPC.connectToNet(id, ip, port, function() {
            remoteIPC.of[id].on('connect', function() {
                resolve(remoteIPC.of[id]);
            });

node-ipc

A nodejs module for local and remote Inter Process Communication (IPC), Neural Networking, and able to facilitate machine learning.

MIT
Latest version published 2 years ago

Package Health Score

50 / 100
Full package analysis