2017-12-19 6 views
0
12-19 13:28:49.902 22731-23091/com.aadi.edusuit W/System.err: java.net.SocketTimeoutException 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at java.net.PlainSocketImpl.read(PlainSocketImpl.java:484) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at java.net.PlainSocketImpl.-wrap0(PlainSocketImpl.java) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:160) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:84) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:273) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:140) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:260) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:283) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:251) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:223) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:271) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:685) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:487) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:860) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at cz.msebera.android.httpclient.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at com.loopj.android.http.AsyncHttpRequest.makeRequest(AsyncHttpRequest.java:146) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at com.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries(AsyncHttpRequest.java:177) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at com.loopj.android.http.AsyncHttpRequest.run(AsyncHttpRequest.java:106) 
12-19 13:28:49.903 22731-23091/com.aadi.edusuit W/System.err:  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) 
12-19 13:28:49.904 22731-23091/com.aadi.edusuit W/System.err:  at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
12-19 13:28:49.904 22731-23091/com.aadi.edusuit W/System.err:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
12-19 13:28:49.904 22731-23091/com.aadi.edusuit W/System.err:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
12-19 13:28:49.904 22731-23091/com.aadi.edusuit W/System.err:  at java.lang.Thread.run(Thread.java:818) 

: -loopj AsyncHttpClientを使用してSocketTimeoutExceptionsを取得する。私は次のコードを実装していた

final int DEFAULT_TIMEOUT = 20 * 1000; 
AsyncHttpClient aClient = new AsyncHttpClient(); 
aClient.setTimeout(DEFAULT_TIMEOUT); 
//... continue as normal 

をしかし、上記のコードは、単一のセッションで1時間のために働きます。同じセッションで別のリクエストをした場合、ソケットタイムアウト例外が再び発生します。

+0

があなたのタイムアウトを増やし、タイムが出doesnot助け増やす – R2R

+0

をチェックしてみてください接続を確立するためには遅すぎるかもしれ増やします。 – Ashwini

答えて

0

は、あなたのタイムアウト時間がインターネット接続がすなわちこの

AsyncHttpClient aClient = new AsyncHttpClient(); 
aClient.setTimeout(70000); 
関連する問題