majidgolshadi / Android-Download-Manager-Pro

Android/Java download manager library help you to download files in parallel mechanism in some chunks.
MIT License
1.62k stars 317 forks source link

read byte is 0 && java.net.SocketTimeoutException #14

Open davitz- opened 9 years ago

davitz- commented 9 years ago

I have set up a longer link time, but there is still a problem

[CDS]read byte is 0 java.net.SocketTimeoutException at java.net.PlainSocketImpl.read(PlainSocketImpl.java:497) at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:42) at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:242) at com.android.okio.Okio$2.read(Okio.java:113) at com.android.okio.RealBufferedSource.read(RealBufferedSource.java:48) at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:446) at com.android.okio.RealBufferedSource$1.read(RealBufferedSource.java:168) at java.io.InputStream.read(InputStream.java:162) at com.golshadi.majid.core.chunkWorker.AsyncWorker.run(AsyncWorker.java:64)

majidgolshadi commented 9 years ago

Would you please describe more?

taimur97 commented 9 years ago

Yes I also saw this exception but I don't know why

460611929 commented 9 years ago

set connection timeout length

ishuqi commented 8 years ago

I have met the SocketTimeoutException too, below is the log 04-01 10:01:27.095: W/System.err(12152): java.net.SocketTimeoutException 04-01 10:01:27.095: W/System.err(12152): at java.net.PlainSocketImpl.read(PlainSocketImpl.java:484) 04-01 10:01:27.095: W/System.err(12152): at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37) 04-01 10:01:27.095: W/System.err(12152): at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237) 04-01 10:01:27.095: W/System.err(12152): at com.android.okhttp.okio.Okio$2.read(Okio.java:135) 04-01 10:01:27.095: W/System.err(12152): at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:211) 04-01 10:01:27.096: W/System.err(12152): at com.android.okhttp.okio.RealBufferedSource.read(RealBufferedSource.java:50) 04-01 10:01:27.096: W/System.err(12152): at com.android.okhttp.internal.http.HttpConnection$FixedLengthSource.read(HttpConnection.java:418) 04-01 10:01:27.096: W/System.err(12152): at com.android.okhttp.okio.RealBufferedSource$1.read(RealBufferedSource.java:349) 04-01 10:01:27.096: W/System.err(12152): at java.io.InputStream.read(InputStream.java:162) 04-01 10:01:27.096: W/System.err(12152): at com.golshadi.majid.core.chunkWorker.AsyncWorker.run(AsyncWorker.java:64)

lekeCoder commented 8 years ago

edit connection.setConnectTimeout() in AsynWorker.java.

That should resolve that error