How to ping an IP address

InetAddress.isReachable() according to javadoc:

“.. A typical implementation will use ICMP ECHO REQUESTs if the
privilege can be obtained, otherwise it will try to establish a TCP
connection on port 7 (Echo) of the destination host..”.

Option #1 (ICMP) usually requires administrative (root) rights.

Leave a Comment