This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: Correction to InetAddress bug?
- To: Lincoln Spiteri <lincoln.spiteri@st.com>
- Subject: Re: Correction to InetAddress bug?
- From: Warren Levy <warrenl@cygnus.com>
- Date: Mon, 26 Jul 1999 18:05:37 -0700 (PDT)
- cc: java-discuss@sourceware.cygnus.com
On Mon, 26 Jul 1999, Lincoln Spiteri wrote:
> I guess that means that all is well with Socket but not in the
> ServerSocket.
>
> On Mon, 26 Jul 1999, lincoln.spiteri@st.com wrote:
> > I am trying to get the host address from both a Socket and a ServerSocket as
> > follows:
> >
> > String address = someSocket.getInetAddress().getHostAddress();
> >
> > this always returns a null.
Hmm, the problem seems to be that the InetAddress that is instantiated
has a null address value. I'll have to look deeper to decide on the
right fix (something might be relying on address being null at times,
though I hope not).
BTW, this doesn't happen with Socket because the address is being set to a
non-null value in the InetAddress created by the accept(). I'll work up
a patch for the problem; thanks for reporting it!
--warrenl