*/
public static String[] listLocalInetAddressNames() {
InetAddress addr;
InetAddress[] addrs;
HashSet set;
set = new HashSet();
try {
addr = InetAddress.getLocalHost();
addrs = InetAddress.getAllByName(addr.getHostAddress());
for (int i = 0; i < addrs.length; i++) {
set.add(addrs[i].getHostAddress());
set.add(addrs[i].getHostName());
}
addrs = InetAddress.getAllByName(addr.getHostName());
for (int i = 0; i < addrs.length; i++) {
set.add(addrs[i].getHostAddress());
set.add(addrs[i].getHostName());
}
} catch (Exception e) {}
try {
addr = InetAddress.getByName(null);
addrs = InetAddress.getAllByName(addr.getHostAddress());
for (int i = 0; i < addrs.length; i++) {
set.add(addrs[i].getHostAddress());
set.add(addrs[i].getHostName());
}
addrs = InetAddress.getAllByName(addr.getHostName());
for (int i = 0; i < addrs.length; i++) {
set.add(addrs[i].getHostAddress());
set.add(addrs[i].getHostName());
}
} catch (Exception e) {}
try {
set.add(InetAddress.getByName("loopback").getHostAddress());
set.add(InetAddress.getByName("loopback").getHostName());
} catch (Exception e) {}
return (String[]) set.toArray(new String[set.size()]);
}