// We're hitting 255 machines in parallel :) // Returns list of found aware machines static bool empBlast_verbose; static L empBlast() { ret empBlast(f isAware); } static L empBlast(fO checkPeer) { final L l = synchroList(); new L threads; S ip = getMyIP(); int i = ip.lastIndexOf('.'); if (i < 0) ret l; S net = substring(ip, 0, i+1); L myIPs = myIPs(); print("EMP-BLASTING " + net + "*"); for (int n = 1; n <= 255; n++) { fS peer = net + n; if (!myIPs.contains(peer)) { S msg = "Peer Scan " + peer; threads.add(startThread(msg, r { bool yes = false; try { yes = isTrue(callF(checkPeer, peer)); if (yes) l.add(peer); } finally { if (empBlast_verbose) print(peer + ": " + (yes ? "Yes" : "No (or timeout)")); } })); } } waitForThreads(threads); ret l; }