File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes calculating number of hops Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "calculating number of hops " Watch "calculating number of hops " New topic

calculating number of hops

thomas Fuchs

Joined: Apr 18, 2007
Posts: 16

Does anyone know of how to calculate/figure out
the number of hops to a server
using java ?

for example: I open up a socket to 'x' from 'y'
how many hops is it from x to y ...

Darrin Cartwright
Ranch Hand

Joined: Dec 27, 2002
Posts: 107
Hi Thomas,

Try exec() with the traceroute command. Something like:

If it has to be "pure" java, I'm afraid I can't help ya.

Life is good on the Ponderosa,<br />but mind where you step.
thomas Fuchs

Joined: Apr 18, 2007
Posts: 16
Thanks very much
this will work great
much appreciated
I agree. Here's the link:
subject: calculating number of hops
It's not a secret anymore!