Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试在我的单例类中设置我的 asynchttpclient 超时,但它似乎没有改变。我得到了 10000,我认为这是默认值。
client.setMaxRetriesAndTimeout(0,5000); Log.i("loopj", ""+ client.getTimeout());
编辑:
client.setTimeout(5000);
这个方法是有效的,但是对于信息,为什么 setMaxRetriesAndTimeout 没有?
好的,我明白了。从文档中,
setMaxRetriesAndTimeout - 设置这些重试之间的最大重试次数和超时时间
setTimeout - 设置连接/套接字超时 - 默认为 10 秒