Hello,
i still have a big problem with linux jdk (1.1.7-alpha, 1.2-pre2-glibc2.0)
that seems somehow be jdk-version unrelated...
using the following code:
import java.io.*;
import java.net.*;
public class IPTest
{
public static int port = 0;
public static String addr = null;
public static void main(String argv[])
{
try
{
java.net.ServerSocket serverSocket = new java.net.ServerSocket( 0
);
port = serverSocket.getLocalPort();
addr = serverSocket.getInetAddress().getLocalHost().toString();
addr = addr.substring(addr.indexOf("/")+1);
System.out.println( "port: " + port + " addr: " + addr );
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
i get wrong results on 50% of my machines!!!! half of them return the loopback
device, all machines are configured nearly identical
the difference somehow manifests at boot when for a reason unkown from me the
different IP interfaces set up...
the machine where all works fine have as first interface eth0, the others have
in general (but there not all) the loopback as first device...
so first question is it related to this? and if yes how to achieve to have
eth0 as the first device??
then on one machine i have :
ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:2B:38:16:29
inet addr:130.79.74.76 Bcast:130.79.74.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:45509662 errors:230 dropped:0 overruns:0 frame:380
TX packets:75856100 errors:27193 dropped:0 overruns:17506
carrier:46581
collisions:4284395 txqueuelen:100
Interrupt:5 Base address:0x3c00
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:8020 Metric:1
RX packets:5336094 errors:0 dropped:0 overruns:0 frame:0
TX packets:5336094 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
java IPTest
port: 1236 addr: 127.0.0.1
and that's clearly wrong and perfectly unusable....
is there any way to force the jdk to use the real ethernet address?
i really need to get this working, since i am working on a CORBA-project and
that without this i can't get my object linked to each other....
--
ciao bboett
==============================================================
[EMAIL PROTECTED]
http://erm6.u-strasbg.fr/~bboett
===============================================================
the total amount of intelligence on earth is constant.
human population is growing....
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]