Why does InetAddress.isReachable return false, when I can ping the IP address?

后端 未结 10 1486
陌清茗
陌清茗 2020-11-22 12:24
InetAddress byName = InetAddress.getByName("173.39.161.140");
System.out.println(byName);
System.out.println(byNam         


        
10条回答
  •  太阳男子
    2020-11-22 12:45

    Since you can ping the computer, your Java process should run with sufficient privileges to perform the check. Probably due to use of ports in the lower range. If you run your java program with sudo/superuser, I'll bet it works.

提交回复
热议问题