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).

1  
!752
2  
3  
p {
4  
  S name = randomID(10);
5  
  nohupJavax("#1003752 " + name);
6  
  
7  
  for (int i = 0; i < 60; i++) {
8  
    for (DialogIO io : talkToAllVMs())
9  
      try {
10  
        io.readLine(); // get greeting
11  
        S a = io.ask(forward("Up Bot", "get name"));
12  
        if (eq(name, matchOK(a))) {
13  
          S pid = io.ask("what is your pid");
14  
          print("VM Found! Process ID: " + pid + ", port: " + io.getPort());
15  
          print("Shutting down VM in seven...");
16  
          sleepSeconds(7);
17  
          io.ask("kill!");
18  
          ret;
19  
        }
20  
      } finally {
21  
        io.close();
22  
      }
23  
    sleepSeconds(1);
24  
  }
25  
  
26  
  print("Weird, VM did not start...");
27  
}

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: 687 / 799
Referenced in: [show references]