InetAddress.getLocalHost()
Andrew Haley
aph@redhat.com
Sun Jun 22 14:24:00 GMT 2003
Mark Wielaard writes:
> Hi,
>
> On Sun, 2003年06月22日 at 15:19, Mohan Embar wrote:
> > Andrew> Out of interest, why do you want to know the local IP address in any
> > Andrew> case?
> >
> > I am also interested in your answer to Andrew's question.
>
> A lot of peer-to-peer protocols require clients to publish the address
> that they can be contacted on by other peers. In that case it is nice to
> know on which interface/ip address the program is actually listening.
Well, okay. But in that case you really do need to know which of your
interfaces is visible to the outside world, and simply picking an
arbitrary one doesn't help much.
Andrew.
More information about the Java
mailing list