You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: increase the readTimeout value of the default OkHttpClient
With the previous value (10 seconds by default), a connection
established with HTTP long-polling was closed if the server did not
send any packet for 10 seconds (the HTTP request would timeout from the
client side).
It will now default to 1 minute, which is above the
`pingInterval + pingTimeout` value from the server.
Note: the connectTimeout and writeTimeout options are left as is (10
seconds), but you may need to increase them depending on your use case:
```
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(20, TimeUnit.SECONDS)
.readTimeout(1, TimeUnit.MINUTES)
.writeTimeout(1, TimeUnit.MINUTES)
.build();
```
Related:
- socketio/socket.io-client-java#491
- socketio/socket.io-client-java#660
Backported from fb531fa
0 commit comments