-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
319f2e2
commit 2d87497
Showing
3 changed files
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters