This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
InetAddress - is it broken??
- From: "Craig A. Vanderborgh" <craigv at voxware dot com>
- To: java at gcc dot gnu dot org
- Date: 12 Jun 2003 13:56:45 -0600
- Subject: InetAddress - is it broken??
Hello gcjland:
I have discovered the following apparently malignant behavior in
InetAddress.getLocalHost() on linux. Given the following brainless
test program:
import java.net.*;
public class InetAddressTest {
public static void main(String[] args) {
System.out.println("getting local host address..");
try {
InetAddress address = InetAddress.getLocalHost();
System.out.println(address);
} catch (UnknownHostException e) {
System.out.println("Could not find local address");
}
}
}
What I see is this:
getting local host address..
zetar/127.0.0.1
The environment is x86linux (RedHat 8.0), gcc/gcj version as follows:
gcj (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
All documentation I have, as well as relevant experience, suggests that
this is incorrect. Perhaps my expectations are incorrect, however.
Please advise.
TIA,
craig vanderborgh
voxware incorporated