I can磘 get the IP address from InetAddress getHostAddress() metyhod

Hi all,

Here is my code:

ssc = ServerSocketChannel.open();

ssc.socket().bind(new InetSocketAddress(4000));

ssc.configureBlocking(false);

When I do:

System.out.println(ssc.socket().getInetAddress().getHostAddress());

It returns: 0.0.0.0

What should I do to obtain IP address correcly ?

Thanks.

[420 byte] By [aboaventuraa] at [2007-11-27 1:37:56]
# 1
That's what it's supposed to return in this case.See InetAddress.getLocalHost().
ejpa at 2007-7-12 0:49:15 > top of Java-index,Core,Core APIs...