docs: add note about the readTimeout value

See also: fb531fab30
This commit is contained in:
Damien Arrachequesne
2022-07-04 02:53:37 +02:00
parent 98d0c13da1
commit de7f932918

View File

@@ -272,8 +272,7 @@ The [OkHttpClient instance](https://square.github.io/okhttp/4.x/okhttp/okhttp3/-
```java ```java
OkHttpClient okHttpClient = new OkHttpClient.Builder() OkHttpClient okHttpClient = new OkHttpClient.Builder()
.readTimeout(1000, TimeUnit.MILLISECONDS) .readTimeout(1, TimeUnit.MINUTES) // important for HTTP long-polling
.writeTimeout(1000, TimeUnit.MILLISECONDS)
.build(); .build();
IO.Options options = new IO.Options(); IO.Options options = new IO.Options();
@@ -421,6 +420,7 @@ sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
OkHttpClient okHttpClient = new OkHttpClient.Builder() OkHttpClient okHttpClient = new OkHttpClient.Builder()
.hostnameVerifier(hostnameVerifier) .hostnameVerifier(hostnameVerifier)
.sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) tmf.getTrustManagers()[0]) .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) tmf.getTrustManagers()[0])
.readTimeout(1, TimeUnit.MINUTES) // important for HTTP long-polling
.build(); .build();
IO.Options options = new IO.Options(); IO.Options options = new IO.Options();
@@ -466,6 +466,7 @@ sslContext.init(null, new TrustManager[] { trustManager }, null);
OkHttpClient okHttpClient = new OkHttpClient.Builder() OkHttpClient okHttpClient = new OkHttpClient.Builder()
.hostnameVerifier(hostnameVerifier) .hostnameVerifier(hostnameVerifier)
.sslSocketFactory(sslContext.getSocketFactory(), trustManager) .sslSocketFactory(sslContext.getSocketFactory(), trustManager)
.readTimeout(1, TimeUnit.MINUTES) // important for HTTP long-polling
.build(); .build();
IO.Options options = new IO.Options(); IO.Options options = new IO.Options();