I've implemented a way to get the RTT in Java on unix systems with the following code:
String command[] = {"ping", "-c4", theIPAddress};
ProcessBuilder pb = new ProcessBuilder(command);
pb.redirectErrorStream(true);
Process p = pb.start();
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while((line = in.readLine()) != null)
//the terminal output with the ping results...
etc...
This works fine and I can calculate the RTT (delay) in ms with the output. However, if a host has blocked ICMP, the ping will time-out. (Even in the Mac OS X Terminal or Windows CMD.)
Now I want to find an alternative way to somehow get the RTT/delay for an IP-address. (I don't want to install software on the host side.) If you can't provide me a Java example, please give me other input. I can translate between many languages, and I really can use Google.