bertrandmartel / speed-test-lib

:cloud: JSpeedTest : speed test client library for Java/Android
MIT License
381 stars 119 forks source link

Setting timeout #2

Closed chandra-kantha closed 8 years ago

chandra-kantha commented 8 years ago

Thanks for such a nice library. Can you add one more parameter for time out. Lets say user is in very low network, I dont want keep the user in the screen for a long time. I just want an option like if the download is not complete in one minute, Just stop speed test process.

bertrandmartel commented 8 years ago

Thank you for your feedback. I added in version 1.07, a socket timeout value in milliseconds you can pass it as argument in SpeedTestSocket constructor.

The following define a socket timeout of 5 seconds :

SpeedTestSocket speedTestSocket = new SpeedTestSocket(5000);

This will trigger a onDownloadError or onUploadError callback and stop tasks when socket communication timeout

To get version 1.07 :

compile 'com.github.akinaru:speedtest:1.07'
bertrandmartel commented 8 years ago

I changed the API in 1.09 to :

speedTestSocket.setSocketTimeout(5000);

This timeout only apply for download (socket read). I will soon add a fix to make it work for upload too

chandra-kantha commented 8 years ago

Okay, Thats great. Thank you.

On Sat, May 14, 2016 at 4:15 AM, Bertrand Martel notifications@github.com wrote:

I changed the API in 1.09 to :

speedTestSocket.setSocketTimeout(5000);

This timeout only apply for download (socket read). I will soon add a fix to make it work for upload too

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/akinaru/speed-test-lib/issues/2#issuecomment-219176854

bertrandmartel commented 8 years ago

Upload timeout was fixed in v1.11 : https://github.com/akinaru/speed-test-lib/commit/43a24c800b9c6476599f358b148d4da4fa09fd9e Default value for both download/upload is set to 10s Let me know if you have any issue

chandra-kantha commented 8 years ago

Okay, Thank you so much. Sure, I will let you know if i find any issues.

On Fri, May 20, 2016 at 5:06 AM, Bertrand Martel notifications@github.com wrote:

Upload timeout was fixed in v1.11 : 43a24c8 https://github.com/akinaru/speed-test-lib/commit/43a24c800b9c6476599f358b148d4da4fa09fd9e Default value for both download/upload is set to 10s Let me know if you have any issue

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/akinaru/speed-test-lib/issues/2#issuecomment-220477781

chandra-kantha commented 8 years ago

Hello,

Is 1.testdebit.info down? I'm not able to do the upload test.

On Fri, May 20, 2016 at 11:32 AM, Chandrakanth Gowda < ckantha.gowda@gmail.com> wrote:

Okay, Thank you so much. Sure, I will let you know if i find any issues.

On Fri, May 20, 2016 at 5:06 AM, Bertrand Martel <notifications@github.com

wrote:

Upload timeout was fixed in v1.11 : 43a24c8 https://github.com/akinaru/speed-test-lib/commit/43a24c800b9c6476599f358b148d4da4fa09fd9e Default value for both download/upload is set to 10s Let me know if you have any issue

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/akinaru/speed-test-lib/issues/2#issuecomment-220477781

bertrandmartel commented 8 years ago

It seems the uri changed. It seems they provide more parameters than before and default uri doesnt work anymore https://testdebit.info/. I will check that

bertrandmartel commented 8 years ago

Change 1.testdebit.info to 2.testdebit.info or 3.testdebit.info

chandra-kantha commented 8 years ago

Ok, Thank you, I changed the URI. Its working.

On Wed, May 25, 2016 at 3:24 PM, Bertrand Martel notifications@github.com wrote:

It seems the uri changed http://1-ipv4.testdebit.info/fichiers/1Mo.dat. It seems they provide more parameters than before and default uri doesnt work anymore https://testdebit.info/

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/akinaru/speed-test-lib/issues/2#issuecomment-221526874