Java and IP address on linux
From: gurtd_dauberie_at_hta-bi.bfh.ch to send email write without _dauberie (gurtd_at_hta-bi.bfh.ch)
Date: 03/29/04
- Next message: Mohammed Mazid: "Update functionality error"
- Previous message: Silvio Bierman: "Re: Is PrintWriter threadsafe?"
- Next in thread: Tony Morris: "Re: Java and IP address on linux"
- Reply: Tony Morris: "Re: Java and IP address on linux"
- Reply: dual0: "Re: Java and IP address on linux"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Mar 2004 01:22:46 -0800
I can't get the correct IP address on Linux...
The following code works properly on Windows and Unix.
But on Linux, I always get the Loopback Address (127.0.0.1)
Here is the code :
//gets the IP via InetAddress class
//works on UNIX and WIN, but not on LINUX !!
InetAddress hostIP = InetAddress.getLocalHost();
String hostIPStr = hostIP.getHostAddress();
Could anyone help ?
Thanks in advance !
dim
- Next message: Mohammed Mazid: "Update functionality error"
- Previous message: Silvio Bierman: "Re: Is PrintWriter threadsafe?"
- Next in thread: Tony Morris: "Re: Java and IP address on linux"
- Reply: Tony Morris: "Re: Java and IP address on linux"
- Reply: dual0: "Re: Java and IP address on linux"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|