static new Map<S, Integer> getBotPort_cache; static int getBotPort_timeout = 5000; // returns 0 if not found static int getBotPort(S searchPattern) { Integer port = getBotPort_cache.get(searchPattern); if (port != null) try { DialogIO io = talkTo("localhost", port); io.waitForLine(/*getBotPort_timeout*/); // TODO: implement S line = io.readLineNoBlock(); if (indexOfIgnoreCase(line, searchPattern) == 0) { io.close(); return port; } } catch (Exception e) { e.printStackTrace(); } for (ProgramScan.Program p : quickBotScan()) if (indexOfIgnoreCase(p.helloString, searchPattern) == 0) { // strict matching - start of hello string only, but case-insensitive getBotPort_cache.put(searchPattern, p.port); return p.port; } return 0; }
Began life as a copy of #1001303
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment