SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

Add shared DevSupportHttpClient singleton (#55575)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55575

The devsupport package creates multiple OkHttpClient instances across different files, each with its own connection pool and thread pool. This is wasteful and introduces bugs (thread-safety race in InspectorNetworkHelper, per-tap allocation in RedBoxContentView).

This diff introduces DevSupportHttpClient, an internal object singleton with two shared clients derived from the same connection pool:
- httpClient: with connect=5s, write=disabled, read=disabled (for HTTP requests)
- websocketClient: derived via newBuilder() with connect=10s, write=10s, read=disabled (for WebSocket/inspector use)

Subsequent diffs in this stack migrate each consumer to use these shared clients.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D93480249

fbshipit-source-id: b489f5946aa0c0a5318f0fb600dec31f373b8c09
N
Nicola Corti committed
d5b3cf0c5f7a7e0751a49ecf196ed136322726ab
Parent: b867b0d