[2543] in java-interest

home help back first fref pref prev next nref lref last post

inetAddress.getByName/Socket bug

daemon@ATHENA.MIT.EDU (Caveh Jalali)
Wed Oct 4 05:18:33 1995

Date: Wed, 4 Oct 1995 00:24:21 -0700
From: caveh@updoc-39.Eng.Sun.COM (Caveh Jalali)
To: java-interest@java.Eng.Sun.COM


this is a strange one:

creating Socket(null, <some-port>, false) actually creates a broadcast
socket instead of a socket to the local machine!  it appears that the
inetAddress for a null hostname is 0.0.0.0, and trying to send to that
address is obviously a broadcast.  getByName() should probably set the
inet address to 127.0.0.1 instead.

the docs for getByName() state:

Returns a network address for the indicated host. A host name of null
refers to any address for the local machine.

-- 
00c
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post