A behavior difference about reachable test for address zero (original) (raw)
Sean Chou zhouyx at linux.vnet.ibm.com
Tue Nov 22 00:40:24 PST 2011
- Previous message: hg: jdk8/tl/jdk: 7114125: TEST_BUG: java/util/Timer/KillThread.java should use volatile cross thread variable declaration
- Next message: A behavior difference about reachable test for address zero
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi all,
I found a behavior difference when running the testcase PingZero on
linux and windows. On Linux, it prints "reachable" while on windows "unreachable", which is the same with the result of running "ping 0.0.0.0" on these two platforms.
Is it a bug or intended?
PingZero.java :
////////////////////////////////////////////////////////////// import java.net.*;
class PingZero { public static void main(String args[]) { try { InetAddress inetAddress = InetAddress.getByAddress(new byte[] { 0, 0, 0, 0 }); boolean b = inetAddress.isReachable((int) (1.0 * 3000)); if (b) { System.out.println(" 0.0.0.0 is reachable ! "); } else { System.out.println(" 0.0.0.0 is not reachable ! "); } } catch (Exception e) { e.printStackTrace(); } } }
//////////////////////////////////////////////////////////////
-- Best Regards, Sean Chou -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/net-dev/attachments/20111122/11d2df6f/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: PingZero.java Type: application/octet-stream Size: 563 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/net-dev/attachments/20111122/11d2df6f/PingZero.java
- Previous message: hg: jdk8/tl/jdk: 7114125: TEST_BUG: java/util/Timer/KillThread.java should use volatile cross thread variable declaration
- Next message: A behavior difference about reachable test for address zero
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]