Re: nearest router
stephane.chouinard.ptelebel@gmail.com wrote:
hi !
is there a java command or a property that I can check ?
probably i can use traceroute, but it will be difficult because i use a
pocket pc ?
nikosft@gmail.com wrote:
The nearest router is the default gateway. There are some commands that
shows that, may be you can invoke the in your java programme.
stephane.chouinard.ptelebel@gmail.com wrote:
hi !
I would like to know if there is a way to retrieve the ip or the name
of the nearest router when we send a socket ?
thanks
Maybe knowing why you need this, we'd be able to give more help.
Generally with network programming, you're not supposed to care/know
about the route. Information is generally sent in the form of
"packets" into a black box (the internet) and comes out the other side
in the same packet form.
If you really must know the first IP in the route, then you need to
find a system specific way (try a networking newsgroup maybe?) and
implement it using JNI or an external process call.