java.net.SocketTimeoutException
java.net.SocketTimeoutException: failed to connect to myhost after 600000ms: isConnected failed: ETIMEDOUT (Connection timed out)
myhost is ok。This error occurs frequently。The version of okhttp is 3.2.0
Please provide an executable test case to demonstrate the problem. I assume it's a layer lower than OkHttp.
Hi @swankjesse I faced similar issue in upload image.
We upgraded okhttp from version 2.3.0 to 3.4.2 even test on 3.5.0 , it works fine on high speed internet like wifi but when we used 3G/2G connection and try to upload around 200KB image file it throws SocketTimeoutException.
I increase connection timeout to 50s from 10s(default) still face same issue.
When I down grade to pervious version 2.3.0 it works charm.
Finally we are thinking to down grade version to 2.3.0 in our app.
Could you please look into this issue on high priority?
Set the timeout to 0 to disable it. We didn't have any timeouts until 2.5.0.
@swankjesse I tried with 0 connection timeout same result
new OkHttpClient.Builder().connectTimeout(0, TimeUnit.MILLISECONDS).build();
The version of okhttp is 3.5.0 but got socket time error(when i am using cellular connection) otherwise in case of wifi it is working fine. @swankjesse before i have used HttpPost it is working fine.
hi @sachinchoudhary , I solved it by increase time out new OkHttpClient.Builder()
.connectTimeout(90, TimeUnit.SECONDS).readTimeout(90, TimeUnit.SECONDS)
.writeTimeout(90, TimeUnit.SECONDS).build(); I have given 90 sec you can give according to your desire.
Hope it will also solve your issue.
Having same scenario . Version 2.6.0
java.net.SocketTimeoutException: failed to connect to...... (port 42839) after 10000ms
fine,is that someone give me help, okhttp version 3.12.7 in my app.