question: public static boolean isLocationReachable ( InetSocketAddress endpoint , int timeoutMs , int retryCount , int retryIntervalMs ) { int retryLeft = retryCount ; while ( retryLeft > 0 ) { try ( Socket s = new Socket ( ) ) { s . connect ( endpoint , timeoutMs ) ; return true ; } catch ( IOException e ) { } finally { SysUtils . sleep ( retryIntervalMs ) ; retryLeft -- ; } } LOG . log ( Level . FINE , "Failed to connect to: {0}" , endpoint . toString ( ) ) ; return false ; }
target:  Tests if a network location is reachable. This is best effort and may give false not reachable.