I have an android app that is working through wifi and connect only to a local server. Normally the internet must be very fast and everything must work fine, however often i have some SocketTimeoutException
:
06-14 01:40:38.141: W/System.err(30529): java.net.SocketTimeoutException
06-14 01:40:38.146: W/System.err(30529): at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
06-14 01:40:38.146: W/System.err(30529): at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)
06-14 01:40:38.146: W/System.err(30529): at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
06-14 01:40:38.146: W/System.err(30529): at com.android.okio.Okio$2.read(Okio.java:116)
06-14 01:40:38.146: W/System.err(30529): at com.android.okio.RealBufferedSource.indexOf(RealBufferedSource.java:150)
06-14 01:40:38.146: W/System.err(30529): at com.android.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:97)
06-14 01:40:38.146: W/System.err(30529): at com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:202)
06-14 01:40:38.146: W/System.err(30529): at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:119)
06-14 01:40:38.146: W/System.err(30529): at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:798)
06-14 01:40:38.146: W/System.err(30529): at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:405)
06-14 01:40:38.146: W/System.err(30529): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:349)
06-14 01:40:38.146: W/System.err(30529): at com.android.okhttp.internal.http.HttpURLConnectionImpl.getHeaderFieldKey(HttpURLConnectionImpl.java:174)
I can't understand as the server is local and connected directly to the wifi rooter. When i see on the log on the server when i have a SocketTimeoutException
then i can see that no request reach the server.
This SocketTimeoutException
is very random, sometime one every hours, sometime more sometime less. sometime i don't have SocketTimeoutException
but the connection is very slow to establish.
Any idea what could be the reason or how can i debug/find the problem ?