Lines Matching defs:const
2 const common = require('../common');
3 const assert = require('assert');
4 const dgram = require('dgram');
5 const util = require('util');
24 const networkInterfaces = require('os').networkInterfaces();
25 const fork = require('child_process').fork;
26 const MULTICASTS = {
30 const LOOPBACK = { IPv4: '127.0.0.1', IPv6: '::1' };
31 const ANY = { IPv4: '0.0.0.0', IPv6: '::' };
32 const FAM = 'IPv4';
35 const PORTS = {};
40 const UDP = { IPv4: 'udp4', IPv6: 'udp6' };
42 const TIMEOUT = common.platformTimeout(5000);
43 const NOW = Date.now();
44 const TMPL = (tail) => `${NOW} - ${tail}`;
49 const interfaceAddress = ((networkInterfaces) => {
50 for (const name in networkInterfaces) {
51 for (const localInterface of networkInterfaces[name]) {
65 const messages = [
78 const IFACES = [ANY[FAM], interfaceAddress, LOOPBACK[FAM]];
79 const workers = {};
80 const listeners = MULTICASTS[FAM].length * 2;
87 const killSubprocesses = (subprocesses) => {
88 for (const i in subprocesses)
106 const IFACE = IFACES[i % IFACES.length];
107 const MULTICAST = MULTICASTS[FAM][i % MULTICASTS[FAM].length];
109 const messagesNeeded = messages.filter((m) => m.rcv &&
112 const worker = fork(process.argv[1],
172 const worker = workers[pid];
202 const sendSocket = dgram.createSocket({
219 const msg = messages[i++];
226 const buf = Buffer.from(TMPL(msg.tail));
250 const IFACE = process.argv[3];
251 const MULTICAST = process.argv[4];
252 const NEEDEDMSGS = Number(process.argv[5]);
253 const SESSION = Number(process.argv[6]);
254 const receivedMessages = [];
257 const listenSocket = dgram.createSocket({