本帖最后由 牛合超 于 2013-4-13 21:27 编辑
提示错误信息
04-10 11:42:00.670: W/System.err(32134): java.net.SocketException: No route to host
04-10 11:42:00.670: W/System.err(32134):
at org.apache.harmony.luni.platform.OSNetworkSystem.connect(Native Method)
04-10 11:42:00.670: W/System.err(32134):
at dalvik.system.BlockGuard$WrappedNetworkSystem.connect(BlockGuard.java:357)
代码编写如下,
/**
* 测试通知的socket
*/
private void socketTest() {
try {
System.out.println("socket===============================socket");
Socket socket = new Socket(".", 5222);
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
无法建立起链接,地址由.改为Ip后,本地的安卓模拟器可以连上,但是手机无法连接,报上述异常,,
高手赐教啊,, |
|