循环J的AsyncHttpclient没有设置正确的超时 [英] Loopj's AsyncHttpclient not setting the correct timeout

查看:2511
本文介绍了循环J的AsyncHttpclient没有设置正确的超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试着设置我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?

推荐答案

好吧,我知道了。从<一个href=\"http://loopj.com/android-async-http/doc/com/loopj/android/http/AsyncHttpClient.html#setMaxRetriesAndTimeout%28int,%20int%29\"相对=nofollow>文档,

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

这篇关于循环J的AsyncHttpclient没有设置正确的超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆