Difference between "is not reachable" and "unknown host"
I've a small java code which test a bunch of hosts which is not reachable.
The important part is this:
for (String host : hosts) {
try {
if (!InetAddress.getByName(host).isReachable(5000)) {
System.err.println(host + " is not reachable!");
}
} catch (UnknownHostException e) {
System.err.println(host + " is unknown");
} catch (IOException e) {
System.err.println(host + "throws IOException!");
}
}
hosts is a String[]-Array full of URL's to test. When I run it, some URL's
comes "... is not reachable!" and sometimes it comes "... is unknown".
But what is the difference between these two?
Not reachable -> No answer after 5sec to the ping
Unknown -> No host found to ping
These are only my thoughts and I can't find any confirmations or
improvements in google.
No comments:
Post a Comment