Closed oneenam closed 9 years ago
This error occur when worker (chunk downloader) can't get any data from target server. Did you test your code with another server?
target server response is ok. checked and tested target server response.
once this error start then again and again this exception shows until uninstall the app and newly install it. with fresh install it works. if lost connection arise then it should retry or clean previous stuffs as if 2nd time it should start as fresh!
I use this library in some applications and i don't have any problem like this. So i have to focus on this issue and find-out why this happen. Would you please help me more to find-out the reason of this problem?
next time when i will get same problem i will post the exception with log. thanks for the nice lib.
Thank you I'm waiting for
again happened :( but this time only once...after then again started working... here is the log that i posted before....is there any function to increase waiting time...or if connection lost then how can I call start process?
/Download﹕ onDownloadProcess: percent: 12.575080871582031 downloadedLength: 2726466
/System.err﹕ java.net.SocketTimeoutException
/System.err﹕ at java.net.PlainSocketImpl.read(PlainSocketImpl.java:491)
/System.err﹕ at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
/System.err﹕ at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
/System.err﹕ at java.io.BufferedInputStream.read(BufferedInputStream.java:304)
/System.err﹕ at libcore.net.http.FixedLengthInputStream.read(FixedLengthInputStream.java:45)
/System.err﹕ at java.io.InputStream.read(InputStream.java:163)
/System.err﹕ at com.golshadi.majid.core.chunkWorker.AsyncWorker.run(AsyncWorker.java:64)
/Download﹕ connectionLost: 1
/--------﹕ raw query
/--------﹕ cr close
Hi, Can you increase HttpURLConnection timeouts on asyncworker class?
HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setConnectTimeout(2000); connection.setReadTimeout(5000);
wooow...thanks for ur quick response...let me try by increasing it.....i am downloading 25mb size file...i will let u know...thanks
I have the same problem, i increased timeouts value and now working with resumable links. but when i download an unresumable link, only about 10 percentage of my file download! What ideas do you have? (sry for my bad ENG ;) )
Resume capability depends on the server from which you are downloading the file. Do you have a chance to change server configuration? I think, unresumable link issue is not related with that project.
for example this is a unresumable link: f.apk4fun.com/f.php?p=869... i can download this link with IDM and ADM without problem but when i want download this link with this lib i get timeout error in log and my download has stopped.
I have the same problem , error log:
/AN﹕ onDownloadProcess,taskid:18,percent:7.520145416259766,downloadedLenth:883995
/AN﹕ onDownloadProcess,taskid:18,percent:7.699812889099121,downloadedLenth:905115
/System.err﹕ java.net.SocketTimeoutException
/System.err﹕ at java.net.PlainSocketImpl.read(PlainSocketImpl.java:492)
/System.err﹕ at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
/System.err﹕ at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:241)
/System.err﹕ at java.io.BufferedInputStream.read(BufferedInputStream.java:304)
/System.err﹕ at libcore.net.http.FixedLengthInputStream.read(FixedLengthInputStream.java:45)
/System.err﹕ at java.io.InputStream.read(InputStream.java:163)
/System.err﹕ at com.golshadi.majid.core.chunkWorker.AsyncWorker.run(AsyncWorker.java:64)
/AN﹕ connectionLost,taskid:18
/--------﹕ raw query
/--------﹕ cr close
/AN﹕ OnDownloadPaused,taskid:18
/System.err﹕ java.net.SocketTimeoutException
/System.err﹕ at java.net.PlainSocketImpl.read(PlainSocketImpl.java:492)
/System.err﹕ at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
/System.err﹕ at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:241)
/System.err﹕ at java.io.BufferedInputStream.read(BufferedInputStream.java:304)
/System.err﹕ at libcore.net.http.FixedLengthInputStream.read(FixedLengthInputStream.java:45)
/System.err﹕ at java.io.InputStream.read(InputStream.java:163)
/System.err﹕ at com.golshadi.majid.core.chunkWorker.AsyncWorker.run(AsyncWorker.java:64)
/AN﹕ connectionLost,taskid:18
/--------﹕ raw query
/--------﹕ cr close
/AN﹕ connectionLost,taskid:17
/--------﹕ raw query
/--------﹕ cr close
I'm trying to dowoload an apk file,about 10M and found this problem;I had tried a lot of times,this problem occured everytime.the download file url is: http://gdown.baidu.com/data/wisegame/91319a5a1dfae322/baidu_16785426.apk
when i increase the timeout in AsyncWorker class,but it dosen't work. I try to download a samll jpg with 371k and it success.
after some tests, the "SocketTimeoutException" may be solved by increasing the HttpURLConnection's timeout. But it will occur"connectionLost" when in downloading process without the "SocketTimeoutException" some times.
just increase the Timeout in AsyncWorker
for the first time downloaded properly...after then always getting this error...why?