concept SuccessfulProxyContact {
S proxy, target;
long lastSuccess;
S targetComputerID;
}
sclass ContactInvisibles {
L<IP> aware, unaware;
Concepts in = mainConcepts;
void doIt() {
aware = findConcepts(in, IP, aware := true);
print("Aware computers I can see: " + struct(collect(aware, "ip")));
unaware = findConcepts(in, IP, aware := false);
print("Computers I could try to proxy-contact: " + struct(collect(unaware, "ip")));
for (IP ip : unaware)
tryToContact(ip.ip);
}
void tryToContact(S target) {
for (IP proxy : aware) pcall {
print("Trying to contact " + target + " through " + proxy.ip);
long time = now();
S answer = sendToPublicCommBotThroughProxy(proxy.ip, target, "test");
print(" Answer: " + answer);
if (match("test", answer)) {
print(" Success!!\n");
SuccessfulProxyContact contact = uniq(SuccessfulProxyContact, proxy := proxy.ip, +target);
cset(contact, lastSuccess := time);
answer = sendToPublicCommBotThroughProxy(proxy.ip, target, forward("Awareness", "get computer id"));
S computerID = matchOK(answer);
if (computerID != null)
cset(contact, targetComputerID := computerID);
break;
}
}
}
}Began life as a copy of #1006044
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: | #1006054 |
| Snippet name: | ContactInvisibles + concepts [Include] |
| Eternal ID of this version: | #1006054/1 |
| Text MD5: | b69da0fdb02f535538e4c30c2a15371c |
| Author: | stefan |
| Category: | javax / networking |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2016-12-15 14:43:32 |
| Source code size: | 1315 bytes / 39 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 972 / 1228 |
| Referenced in: | [show references] |