Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OkHttp3 Socket Timeout #15

Open
canusx opened this issue Nov 3, 2020 · 4 comments
Open

OkHttp3 Socket Timeout #15

canusx opened this issue Nov 3, 2020 · 4 comments

Comments

@canusx
Copy link

canusx commented Nov 3, 2020

if upload large file okhhtp fired a timeout exeption :

W/System.err( 9731): java.net.SocketTimeoutException: timeout
W/System.err( 9731): 	at okio.Okio$4.newTimeoutException(Okio.java:232)
W/System.err( 9731): 	at okio.AsyncTimeout.exit(AsyncTimeout.java:285)
W/System.err( 9731): 	at okio.AsyncTimeout$1.write(AsyncTimeout.java:184)
W/System.err( 9731): 	at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:179)
W/System.err( 9731): 	at okio.RealBufferedSink.write(RealBufferedSink.java:42)
W/System.err( 9731): 	at okhttp3.internal.http1.Http1Codec$FixedLengthSink.write(Http1Codec.java:295)
W/System.err( 9731): 	at okio.ForwardingSink.write(ForwardingSink.java:35)
W/System.err( 9731): 	at okhttp3.internal.http.CallServerInterceptor$CountingSink.write(CallServerInterceptor.java:149)
W/System.err( 9731): 	at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:179)
W/System.err( 9731): 	at okio.RealBufferedSink.write(RealBufferedSink.java:42)
W/System.err( 9731): 	at okio.ForwardingSink.write(ForwardingSink.java:35)
W/System.err( 9731): 	at com.brainants.multipartrequest.ProgressRequestBody$CountingSink.write(ProgressRequestBody.java:55)
W/System.err( 9731): 	at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.java:179)
W/System.err( 9731): 	at okio.RealBufferedSink.writeAll(RealBufferedSink.java:107)
W/System.err( 9731): 	at okhttp3.RequestBody$3.writeTo(RequestBody.java:120)
W/System.err( 9731): 	at okhttp3.MultipartBody.writeOrCountBytes(MultipartBody.java:173)
W/System.err( 9731): 	at okhttp3.MultipartBody.writeTo(MultipartBody.java:114)
W/System.err( 9731): 	at com.brainants.multipartrequest.ProgressRequestBody.writeTo(ProgressRequestBody.java:44)
W/System.err( 9731): 	at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:72)
W/System.err( 9731): 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
W/System.err( 9731): 	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
W/System.err( 9731): 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
W/System.err( 9731): 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
W/System.err( 9731): 	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
W/System.err( 9731): 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
W/System.err( 9731): 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
W/System.err( 9731): 	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
W/System.err( 9731): 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
W/System.err( 9731): 	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
W/System.err( 9731): 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
W/System.err( 9731): 	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
W/System.err( 9731): 	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:254)
W/System.err( 9731): 	at okhttp3.RealCall.execute(RealCall.java:92)
W/System.err( 9731): 	at com.brainants.multipartrequest.MultipartRequest.sendMultipartRequest(MultipartRequest.java:43)
W/System.err( 9731): 	at com.brainants.multipartrequest.MultipartRequestPlugin$1.doInBackground(MultipartRequestPlugin.java:43)
W/System.err( 9731): 	at com.brainants.multipartrequest.MultipartRequestPlugin$1.doInBackground(MultipartRequestPlugin.java:38)
W/System.err( 9731): 	at android.os.AsyncTask$3.call(AsyncTask.java:394)
W/System.err( 9731): 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
W/System.err( 9731): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
W/System.err( 9731): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err( 9731): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err( 9731): 	at java.lang.Thread.run(Thread.java:923)
W/System.err( 9731): Caused by: java.net.SocketException: Socket closed
W/System.err( 9731): 	at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:124)
W/System.err( 9731): 	at java.net.SocketOutputStream.write(SocketOutputStream.java:161)
W/System.err( 9731): 	at com.android.org.conscrypt.ConscryptEngineSocket$SSLOutputStream.writeToSocket(ConscryptEngineSocket.java:715)
W/System.err( 9731): 	at com.android.org.conscrypt.ConscryptEngineSocket$SSLOutputStream.writeInternal(ConscryptEngineSocket.java:689)
W/System.err( 9731): 	at com.android.org.conscrypt.ConscryptEngineSocket$SSLOutputStream.write(ConscryptEngineSocket.java:652)
W/System.err( 9731): 	at okio.Okio$1.write(Okio.java:79)
W/System.err( 9731): 	at okio.AsyncTimeout$1.write(AsyncTimeout.java:180)
W/System.err( 9731): 	... 39 more

@ward975
Copy link

ward975 commented Mar 4, 2021

Any updates?

@WardMraisheh
Copy link

??

@WardMraisheh
Copy link

Any idea to catch this exception?

@ajayEtelligens
Copy link

I m getting the same error, anyone got any solution yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants