public static PingResult doPing(InetAddress ia, PingOptions pingOptions) {

        // Try native ping first
        try {
            return PingTools.doNativePing(ia, pingOptions);
        } catch (InterruptedException e) {
            PingResult pingResult = new PingResult(ia);
            pingResult.isReachable = false;
            pingResult.error = "Interrupted";
            return pingResult;
        } catch (Exception ignored) {
        }

        // Fallback to java based ping
        return PingTools.doJavaPing(ia, pingOptions);
    }
Perform a ping using the native ping tool and fall back to using java echo request
on failure.

@param ia            - address to ping
@param pingOptions   - ping command options
@return - the ping results
library/src/main/java/com/stealthcopter/networktools/ping/PingTools.java