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

27
LINES

< > BotCompany Repo | #1001632 // injectToAll - inject code to all VMs

JavaX fragment (include)

1  
static class Injection {
2  
  int vmPort;
3  
  S injectionID;
4  
}
5  
6  
static L<Injection> injectToAll(S progID) {
7  
  new L<Injection> l;
8  
  
9  
  S line = format3("Please inject program *.", progID);
10  
  
11  
  for (DialogIO injectionPoint : talkToAll("This is a JavaX VM."))
12  
    try {
13  
      injectionPoint.readLine();
14  
      S answer = injectionPoint.askLoudly(line);
15  
      new Matches m;
16  
      if (match3("OK. Injection ID: *", answer, m)) {
17  
        new Injection i;
18  
        i.vmPort = injectionPoint.getSocket().getPort();
19  
        i.injectionID = m.unq(0);
20  
        l.add(i);
21  
      } // just ignore for now if bad result
22  
    } finally {
23  
      injectionPoint.close();
24  
    }
25  
    
26  
  ret l;
27  
}

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

Snippet ID: #1001632
Snippet name: injectToAll - inject code to all VMs
Eternal ID of this version: #1001632/1
Text MD5: cde0d06dda8e3a3384c9bbe4bbdf04af
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-10-30 14:47:04
Source code size: 693 bytes / 27 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 577 / 800
Referenced in: [show references]