I'm trying to go through a list of URL's and grab their IP but what I'm noticing is sometimes it will get hung up on a website and never move on and other times it will skip a bunch of websites. Does anyone know what's causing this?
for (String site : sites) {
try {
address = InetAddress.getByName(new URL(site).getHost()).getHostAddress();
} catch (Exception e) {
System.out.println(e);
}
IPList.put(address, site);
publish(site);
}
EDIT: I've narrowed the problem down to the publish method. It seems like it's finishing the for loop before it has a chance to publish everything and then it just stops...
EDIT2: Figured it out, small mistake on my end. Thanks.