DSBridge-Android icon indicating copy to clipboard operation
DSBridge-Android copied to clipboard

频繁请求出现okhttp超时

Open yangwubo0800 opened this issue 5 years ago • 0 comments

E/AjaxHandler: okHttpClient:在线接口返回失败 IOException = Failed to connect to XXXXXX; android.system.ErrnoException: connect failed: ETIMEDOUT (Connection timed out)

建议作者将demo中的AjaxHandler类中的 okHttpClient 对象改成静态或者单例,不要在try catch 中每次去new, 这边测试发现当前端频繁请求拦截到AjaxHandler中处理OKHttp 请求时,容易出现如上报错,连接超时,怀疑是多个client对象导致的问题,将其改为静态变量后,测试没有复现。

yangwubo0800 avatar Jul 23 '19 08:07 yangwubo0800