static L getMyIPs() ctex { new TreeSet ips; Enumeration interfaces = NetworkInterface.getNetworkInterfaces(); while (interfaces.hasMoreElements()) { NetworkInterface iface = interfaces.nextElement(); // filters out 127.0.0.1 and inactive interfaces if (iface.isLoopback() || !iface.isUp()) continue; Enumeration addresses = iface.getInetAddresses(); while(addresses.hasMoreElements()) { InetAddress addr = addresses.nextElement(); S ip = addr.getHostAddress(); if (ip.startsWith("127.")) continue; ips.add(ip); } } return new ArrayList(ips); }