1 | static S hostToIP(S host) ctex { |
2 | for (InetAddress a : InetAddress.getAllByName(host)) { |
3 | S ip = a.getHostAddress(); |
4 | if (isIPv4(ip)) ret ip; // yep we're still on v4 |
5 | } |
6 | fail("No IP address found for " + host); |
7 | } |
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ekrmjmnbrukm, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1007894 |
Snippet name: | hostToIP - fails if no address found |
Eternal ID of this version: | #1007894/7 |
Text MD5: | 994a1f17b434d66d021df2cf7cf41b70 |
Author: | stefan |
Category: | javax / networking |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-04-15 15:13:05 |
Source code size: | 228 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 619 / 615 |
Version history: | 6 change(s) |
Referenced in: | [show references] |