0

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 ?

zeus
  • 12,173
  • 9
  • 63
  • 184
  • Anything like this problem? https://stackoverflow.com/questions/45860400/multithreaded-server-randomly-throws-java-net-sockettimeoutexception-read-timed – Dave Nottage Jun 14 '18 at 09:29
  • @DaveNottage not sure, as i have also this error when i start the app :( – zeus Jun 14 '18 at 21:41

0 Answers0