VMware Cloud Community
mschubi
Enthusiast
Enthusiast
Jump to solution

System.isHostReachable sometimes return wrong value

Hello,

to check if a VM is after deployment realy accessable via network i use the method "System.isHostReachable(IP,1000);".

But sometimes this function returns false although the Host is reachable by vRO Aplliance, Client and all other comuputers.

Is there a known problem with "isHostReachable" or has someone the same problem or solution?

best regards,

Mike

Reply
0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi Mike,

System.isHostReachable() is a thin wrapper around Java's InetAddress#isReachable(). If you google it, you'll find that it is a known issue with isReachable() not working very reliable.

Here are some links:

http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4921816

http://stackoverflow.com/questions/9922543/why-does-inetaddress-isreachable-return-false-when-i-can-...

http://stackoverflow.com/questions/4779367/problem-with-isreachable-in-inetaddress-class

View solution in original post

Reply
0 Kudos
2 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi Mike,

System.isHostReachable() is a thin wrapper around Java's InetAddress#isReachable(). If you google it, you'll find that it is a known issue with isReachable() not working very reliable.

Here are some links:

http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4921816

http://stackoverflow.com/questions/9922543/why-does-inetaddress-isreachable-return-false-when-i-can-...

http://stackoverflow.com/questions/4779367/problem-with-isreachable-in-inetaddress-class

Reply
0 Kudos
mschubi
Enthusiast
Enthusiast
Jump to solution

Hello Ilian,

thanks to claryfy the function behind the scenes.

Is there an other possibility without calling external "ping"?

Thank you,

Mike

Reply
0 Kudos