Correction to InetAddress bug?

Lincoln Spiteri lincoln.spiteri@st.com
Mon Jul 26 08:02:00 GMT 1999


I collected some data:
ServerSocket
 
getHostAddress gcj -> java.Lang.NullPointerException
 java -> 0.0.0.0
getHostName gcj -> java.Lang.NullPointerException
 java -> 0.0.0.0
Socket
getHostAddress gcj -> 127.0.0.1
 java -> 127.0.0.1
getHostName gcj -> localhost
 java -> localhost
I guess that means that all is well with Socket but not in the
ServerSocket.
Lincoln
 On 1999年7月26日, lincoln.spiteri@st.com wrote:
> Hello,
>> 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.
>> I am initialising the ServerSocket with the ServerSocket(porNumber) constructor
> and the other socket comes from an accept call on the server socket 
>>> Is this invalid code or a bug?
>> Regards
>> Lincoln
--
------------------------------------------------------------------------------
Lincoln Spiteri
Manufacturing Systems
STMicroelectronics, Malta
e-mail: lincoln.spiteri@st.com
------------------------------------------------------------------------------


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /