问题描述
- android发送http请求很不稳定,有时连不上就一直连不上
- 09-13 16:41:55.705: W/System.err(29888): java.net.SocketTimeoutException: Connection timed out
09-13 16:41:55.705: W/System.err(29888): at org.apache.harmony.luni.platform.OSNetworkSystem.connect(Native Method)
09-13 16:41:55.705: W/System.err(29888): at dalvik.system.BlockGuard$WrappedNetworkSystem.connect(BlockGuard.java:357)
09-13 16:41:55.705: W/System.err(29888): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:204)
09-13 16:41:55.705: W/System.err(29888): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:437)
09-13 16:41:55.705: W/System.err(29888): at java.net.Socket.connect(Socket.java:983)
09-13 16:41:55.705: W/System.err(29888): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.(HttpConnection.java:75)
09-13 16:41:55.705: W/System.err(29888): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.(HttpConnection.java:48)
09-13 16:41:55.705: W/System.err(29888): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:322)
09-13 16:41:55.705: W/System.err(29888): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
09-13 16:41:55.705: W/System.err(29888): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)
09-13 16:41:55.705: W/System.err(29888): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)
09-13 16:41:55.705: W/System.err(29888): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1018)
09-13 16:41:55.705: W/System.err(29888): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:512)常常报这个异常,手机是可以联网的,其他应用比如微博都能上。我的应用出现一次这个异常之后,每次都这样,要重启才能恢复
时间: 2024-09-22 15:24:48