Skip to content

Commit

Permalink
okhttp: remove keepAlive = false
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliskov committed Apr 28, 2024
1 parent 026eed0 commit 46c760a
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -95,11 +95,11 @@ private static void setupConnectionParams(OkHttpClient.Builder okBuilder) {
okBuilder.readTimeout(READ_TIMEOUT_MS, TimeUnit.MILLISECONDS);
okBuilder.writeTimeout(WRITE_TIMEOUT_MS, TimeUnit.MILLISECONDS);

// Imitate 'keepAlive' = false (yt throttle fix?)
// Imitate 'keepAlive' = false (yt throttle fix? Cause slow video loading?)
// https://stackoverflow.com/questions/70873186/how-to-disable-connection-pooling-and-make-a-new-connection-for-each-request-in
// https://stackoverflow.com/questions/63047533/connection-pool-okhttp
// NOTE: SocketTimeoutException fix: setup connection pool with 0 (!) idle connections!
okBuilder.connectionPool(new ConnectionPool(0, READ_TIMEOUT_MS, TimeUnit.MILLISECONDS));
//okBuilder.connectionPool(new ConnectionPool(0, READ_TIMEOUT_MS, TimeUnit.MILLISECONDS));
}

/**
Expand Down

0 comments on commit 46c760a

Please sign in to comment.