异常信息:java.net.NoRouteToHostException: No route to host
Socket(客户端)建立代码:
try {
socket = new Socket(InetAddress.getByName( "221.133.231.38 "),554);
//socket = new Socket( "221.133.231.38 ",554);
System.out.println( "mark 2 ");
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
--------------------------------------------------
socket = new Socket(InetAddress.getByName( "221.133.231.38 "),554);这句话引出的异常,可我以前都是这样写的!IP可以ping通,这是怎么回事?
rtsp://221.133.231.38:554/timeradio.rm这个地址也是好的!
这是为什么?这是为什么?
------解决方法--------------------------------------------------------
socket = new Socket( "221.133.231.38 ",554);
直接写不就行了吗?
然后再跟踪下InetAddress.getByName( "221.133.231.38 ")这是不是没取到值,这两句话应该是等价的
java.net.NoRouteToHostException: No route to host没有找到路由,换下端口
教科书上写着1-1024是系统保留端口~~用9819
------解决方法--------------------------------------------------------
路由有没有映射你那个端口?