This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: java.net.InetAddress


Erik,

I've had a chance to look into this at long last.

>What I'm actually interested in, is the address "192.168.0.2"; the one
>assigned to my machine by dhcpcd.
>
>Regardless of what I try, however, java.net.InetAddress will never
>return this address. It will always return the (absolutely useless)
>loopback address "127.0.0.1":

On my WinXP machine, both the JDK 1.4.1_01 and a recent unpublished
GCJ 3.4 build produce identical results:

local ip: 192.168.10.14
localhost: p733
getByName:192.168.10.14
address count: 1
ip:192.168.10.14

On my Linux box, the JDK 1.4.1-rc-b19 produces this:

local ip: 127.0.0.1
localhost: p450.veganteam.com
getByName:127.0.0.1
address count: 1
ip:127.0.0.1

So in both cases, it appears that GCJ is consistent with the JDK.

I don't have Linux or MingW 3.3 builds handy, but I expect
the results to be similar.

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]