循环J的AsyncHttpclient没有设置正确的超时正确、AsyncHttpclient

2023-09-07 22:57:03 作者:北念

我试着设置我asynchttpclient的超时时间在我的单身类,但它似乎并没有改变。我得到了我认为10000是默认值。

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());

编辑:

client.setTimeout(5000);

这种方法工作,但对于信息,怎么来setMaxRetriesAndTimeout不?

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

推荐答案

好吧,我知道了。从文档,

setMaxRetriesAndTimeout - 设置这些试之间的最大重试次数和超时

setMaxRetriesAndTimeout - sets the maximum retries and timeout between those retries

的setTimeout - 设置连接/套接字超时 - 这一个是默认的10秒

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

 
精彩推荐
图片推荐