Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

OkHttp3 Never Timeout on slow internet

OkHttpClient client = new OkHttpClient.Builder()
            .connectTimeout(20, TimeUnit.SECONDS)
            .callTimeout(20, TimeUnit.SECONDS)
            .writeTimeout(20, TimeUnit.SECONDS)
            .readTimeout(20, TimeUnit.SECONDS)
            .retryOnConnectionFailure(false)
            .build();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Never #Timeout #slow #internet
ADD COMMENT
Topic
Name
5+6 =