// Get SUB ports from args subPorts.forEach(p => { console.log(`Subscribing to ${p}`); // Connect SUB ports to the PUB sockets of the other instances of our application subSocket.connect(`tcp://127.0.0.1:${p}`); });
async function run() { await request.connect("tcp://127.0.0.1:7000"); const zmqm = new ZmqMiddlewareManager(request); zmqm.use(jsonMiddleware.json()); zmqm.use({ inbound: function(message, next) { console.log("Echoed back: ", message.data); next(); } }); setInterval(() => { zmqm.send({ action: "ping", echo: Date.now() }); }, 1000); }
handler.connect(addr) tt.on('end', () => { handler.removeAllListeners()
handler.connect(addr) tt.on('end', () => { handler.removeAllListeners()