Questions tagged «request-timed-out»

2
截击请求重试策略不考虑超时
我已将1500设置为initialTimeoutMs在DefaultRetryPolicy,如下所示,但它不考虑超时: request.setRetryPolicy(new DefaultRetryPolicy(1500 , DefaultRetryPolicy.DEFAULT_MAX_RETRIES , DefaultRetryPolicy.DEFAULT_BACKOFF_MULT)); 我断开了设备上的WiFi的连接以测试其超时,然后在 Logcat中: 2019-12-16 14:28:15.892 I/MyClass: request sent 2019-12-16 14:28:35.930 I/MyClass: request caught onError 花了超过20秒的时间,而我希望在1.5秒后捕获onResponse或onError !!!
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.