Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

27
LINES

< > BotCompany Repo | #1003753 // Try Starting a VM and Identifying Its Port

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2459L/16K/57K).

!752

p {
  S name = randomID(10);
  nohupJavax("#1003752 " + name);
  
  for (int i = 0; i < 60; i++) {
    for (DialogIO io : talkToAllVMs())
      try {
        io.readLine(); // get greeting
        S a = io.ask(forward("Up Bot", "get name"));
        if (eq(name, matchOK(a))) {
          S pid = io.ask("what is your pid");
          print("VM Found! Process ID: " + pid + ", port: " + io.getPort());
          print("Shutting down VM in seven...");
          sleepSeconds(7);
          io.ask("kill!");
          ret;
        }
      } finally {
        io.close();
      }
    sleepSeconds(1);
  }
  
  print("Weird, VM did not start...");
}

download  show line numbers  debug dex  old transpilations   

Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, jtubtzbbkimh, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

Comments [hide]

ID Author/Program Comment Date
1269 stefan Works!! 2016-07-26 19:44:16

add comment

Snippet ID: #1003753
Snippet name: Try Starting a VM and Identifying Its Port
Eternal ID of this version: #1003753/1
Text MD5: 3e54e0b79473dac25dacb1c04775ea0e
Transpilation MD5: ae36641c5a3f82e55e3139031a3c730d
Author: stefan
Category: javax / javafx
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-07-26 23:23:20
Source code size: 675 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 683 / 792
Referenced in: [show references]