Loopj's AsyncHttpclient not setting the correct timeout

让人想犯罪 __ 提交于 2019-12-22 06:59:28

问题


I tried setting my asynchttpclient's timeout in my singleton class but it seems that it doesn't change. I got the 10000 which I think is the default value.

client.setMaxRetriesAndTimeout(0,5000);
Log.i("loopj", ""+ client.getTimeout());

EDIT:

client.setTimeout(5000);

this method is working but for the information, how come setMaxRetriesAndTimeout doesn't?


回答1:


Okay, I got it. From the docs,

setMaxRetriesAndTimeout - sets the maximum retries and timeout between those retries

setTimeout - sets the connect/socket timeout - this one is the 10s by default



来源:https://stackoverflow.com/questions/20853732/loopjs-asynchttpclient-not-setting-the-correct-timeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!