From: Carsten W. <ca...@us...> - 2005-10-26 12:38:08
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9454/src/jake2/qcommon Modified Files: netadr_t.java Log Message: solves a bug, reported by Ken Russell from sun. (Problems with jdk1.6 and special network configs) The localhost address was null by calling InetAddress.getByName("localhost").getAddress() see java api doc: InetAddress.getByName(null) is the correct (but strange) method to get the localhost InetAddress. Index: netadr_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/netadr_t.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** netadr_t.java 20 Oct 2004 20:37:32 -0000 1.5 --- netadr_t.java 26 Oct 2005 12:37:58 -0000 1.6 *************** *** 41,45 **** this.port = 0; // any try { ! this.ip = InetAddress.getByName("localhost").getAddress(); } catch (UnknownHostException e) { } --- 41,46 ---- this.port = 0; // any try { ! // localhost / 127.0.0.1 ! this.ip = InetAddress.getByName(null).getAddress(); } catch (UnknownHostException e) { } *************** *** 51,55 **** return InetAddress.getByName("255.255.255.255"); case Defines.NA_LOOPBACK: ! return InetAddress.getByName("localhost"); case Defines.NA_IP: return InetAddress.getByAddress(ip); --- 52,57 ---- return InetAddress.getByName("255.255.255.255"); case Defines.NA_LOOPBACK: ! // localhost / 127.0.0.1 ! return InetAddress.getByName(null); case Defines.NA_IP: return InetAddress.getByAddress(ip); |