Comments (10)
你是怎么设置的超时?读、写、连接超时各设置的多少?加载中时间大概多长?
from rxhttp.
@liujingxing 读、写、连接超时都是30s,但一直没有结果返回,超时也没有起作用,是okhttp的问题吗?
from rxhttp.
读、写、连接超时都是30s的话,最差的情况是90s才会触发超时异常。解决办法有两个:
1、读、写、连接超时时间设置短一点,如都设置10s,此时最差的情况也就30s内会触发超时异常
2、通过timeout方法,为单个请求设置超时时间,这个时间应小于读、写、连接超时时间之和。通过次方法设置的超时时间,就会在规定的时间内触发超时异常。
from rxhttp.
@liujingxing 好的,我试一下,多谢
from rxhttp.
嗯,遇到问题可以进群378530627,方便沟通
from rxhttp.
读、写、连接超时时间设置分别为30,30,10,
我为单个请求设置超时时间为50,
但是超时时间还是30s,请问这是为什么呢?
from rxhttp.
你要了解下读、写、连接超时及总超时的区别,看这里。https://github.com/liujingxing/okhttp-RxHttp/wiki/%E8%B6%85%E6%97%B6%E8%AE%BE%E7%BD%AE
from rxhttp.
读、写、连接超时时间之和为30s+30s+10s=70s,
timeout总超时时间为50s,
为什么是无效的呢?
from rxhttp.
举个例子,你要下载一个100M的文件,1s内就连接上了,接着开始下载,而下载会在while循环里不停的调用read方法,每次read,都会开启倒计时(时间为你设置的读超时),而如果第一次读就超时了,那从开始到超时就是31s,那么你设置总超时50s就不会触发。
from rxhttp.
好的 谢谢
from rxhttp.
Related Issues (20)
- 用Java自定义解析器,wrappers参数传入`List.class`,ksp编译后BaseRxHttp类报错 HOT 1
- JSON日志显示问题 HOT 2
- toDownloadFlow点击Cannot find declaration to go to HOT 5
- rxhttp最低支持的gradle和kotlin版本是多少 HOT 6
- java.lang.NoSuchFieldError: No field Companion of type HOT 10
- 自动刷新问题 HOT 1
- Cannot resolve symbol 'RxHttp' HOT 9
- 下载文件可能会超时,怎么解决? HOT 2
- 打印日志添加缓存信息 HOT 1
- 有时候后台会返回一些意想不到的json HOT 11
- 编译报错了 HOT 5
- 关于后端接口数据返回null,但是接口成功自定义Parser的问题 HOT 5
- RxHttp 生成在 AndroidTest 目录 HOT 3
- ksp编译,未使用任何注解,随意更改子module中的代码,运行项目,编译报错,提示找不到RxHttp类 HOT 1
- 服务器返回数据特殊处理 HOT 6
- 打印日志是有长度限制吧?请求参数过长日志打印不全,建议提供方法设置可控制 HOT 2
- 不能直接得到Response吗 HOT 3
- java.lang.NullPointerException: <get-cache>(...) must not be null 这种一般是什么问题呀,不是必现,偶尔出现就会闪退。 HOT 3
- 自定义parser生成失败 HOT 7
- 关于默认域名的问题 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxhttp.