03-29 12:16:38.997 32066-4018/com.mobile W/System.err: java.net.socketTimeoutException: timeout 03-29 12:16:38.997 32066-4018/com.mobile W/System.err: at okio.Okio.newTimeoutException(Okio.java:207) 03-29 12:16:38.997 32066-4018/com.mobile W/System.err: at okio.AsyncTimeout.exit(AsyncTimeout.java:261) 03-29 12:16:38.997 32066-4018/com.mobile W/System.err: at okio.AsyncTimeout.write(AsyncTimeout.java:158) 03-29 12:16:38.997 32066-4018/com.mobile W/System.err: at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:176) 03-29 12:16:38.997 32066-4018/com.mobile W/System.err: at okio.RealBufferedSink.write(RealBufferedSink.java:46) 03-29 12:16:38.997 32066-4018/com.mobile W/System.err: at okhttp3.internal.http.http1xStream$FixedLengthSink.write(http1xStream.java:286) 03-29 12:16:38.997 32066-4018/com.mobile W/System.err: at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:176) 03-29 12:16:38.997 32066-4018/com.mobile W/System.err: at okio.RealBufferedSink.write(RealBufferedSink.java:96) 03-29 12:16:38.997 32066-4018/com.mobile W/System.err: at okhttp3.Requestbody.writeto(Requestbody.java:96) 03-29 12:16:38.997 32066-4018/com.mobile W/System.err: at okhttp3.internal.http.httpEngine$NetworkInterceptorChain.proceed(httpEngine.java:704) 03-29 12:16:38.997 32066-4018/com.mobile W/System.err: at okhttp3.internal.http.httpEngine.readResponse(httpEngine.java:563) 03-29 12:16:38.997 32066-4018/com.mobile W/System.err: at okhttp3.RealCall.getResponse(RealCall.java:241) 03-29 12:16:38.997 32066-4018/com.mobile W/System.err: at okhttp3.RealCall$ApplicationInterceptorChain.proceed(RealCall.java:198) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:160) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: at okhttp3.RealCall.execute(RealCall.java:57) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: at com.mobizio.API.BaseAPI.sendOkhttpRequest(BaseAPI.java:81) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: at com.mobizio.API.BaseAPI.doInBackground(BaseAPI.java:45) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: at com.mobizio.API.BaseAPI.doInBackground(BaseAPI.java:30) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: at androID.os.AsyncTask.call(AsyncTask.java:292) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: at java.lang.Thread.run(Thread.java:818) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: Caused by: java.net.socketException: socket is closed 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: at com.androID.org.conscrypt.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:759) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: at okio.Okio.write(Okio.java:80) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: at okio.AsyncTimeout.write(AsyncTimeout.java:155) 03-29 12:16:38.998 32066-4018/com.mobile W/System.err: ... 20 more解决方法 对于Okhttp 3,Okhttp的默认值为10秒.您可以将超时增加到30秒.
OkhttpClIEnt clIEnt = new OkhttpClIEnt();clIEnt.setConnectTimeout(30,TimeUnit.SECONDS); // connect timeoutclIEnt.setReadTimeout(30,TimeUnit.SECONDS); // socket timeout总结
以上是内存溢出为你收集整理的android – java.net.SocketTimeoutException:timeout全部内容,希望文章能够帮你解决android – java.net.SocketTimeoutException:timeout所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)