mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
DevSupportHttpClient uses OkHttpClientProvider (#55886)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55886 Instead of creating an independent OkHttpClient, derive from OkHttpClientProvider.getOkHttpClient() so that all dev support connections share the same connection pool and dispatcher with the rest of React Native networking. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D95058926 fbshipit-source-id: d82c9ce89e46130683fcb9492f4d36a302e081c9
This commit is contained in:
1 parent
8487b6d03b
commit
c45c5cfc8b
1 file changed
+3
-1
+3
-1
@@ -9,6 +9,7 @@
|
||||
|
||||
package com.facebook.react.devsupport.inspector
|
||||
|
||||
import com.facebook.react.modules.network.OkHttpClientProvider
|
||||
import java.util.concurrent.TimeUnit
|
||||
import okhttp3.OkHttpClient
|
||||
|
||||
@@ -19,7 +20,8 @@ import okhttp3.OkHttpClient
|
||||
internal object DevSupportHttpClient {
|
||||
/** Client for HTTP requests: connect=5s, write=disabled, read=disabled. */
|
||||
internal val httpClient: OkHttpClient =
|
||||
OkHttpClient.Builder()
|
||||
OkHttpClientProvider.getOkHttpClient()
|
||||
.newBuilder()
|
||||
.connectTimeout(5, TimeUnit.SECONDS)
|
||||
.writeTimeout(0, TimeUnit.MILLISECONDS)
|
||||
.readTimeout(0, TimeUnit.MINUTES)
|
||||
|
||||
Reference in new issue
Block a user