码迷,mamicode.com
首页 > Web开发 > 详细

InetAddress.getByName

时间:2014-12-14 22:29:42      阅读:522      评论:0      收藏:0      [点我收藏+]

标签:style   blog   ar   color   os   sp   java   div   log   

最近在做多媒体交互系统,发现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

InetAddress.getByName

标签:style   blog   ar   color   os   sp   java   div   log   

原文地址:http://www.cnblogs.com/ziyinxing/p/4163095.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!