InetAddress.getByName

最近在做多媒体交互系统,发现InetAddress.getByName("224.224.10.0")里面的地址去掉,还是可以访问到主机

import java.net.InetAddress;  
  
public class TestInetAddressGetAddress {  

    public static void main(String[] args) throws stu {   
        InetAddress ia = InetAddress.getByName("");  
        System.out.println(ia);  
        System.out.println("是否可以达到该地址:"+ia.isReachable(5000));  
    }  
}  

运行结果:
localhost/172.18.0.1
是否可以达到该地址:true

posted on 2014-12-14 21:50  笨蛋紫银星  阅读(1777)  评论(1编辑  收藏  举报