Enable WebSockets for Android
Summary: This change effectively prioritises WebSocket over RSocket connections for Android. Reviewed By: passy Differential Revision: D32490095 fbshipit-source-id: 836438970f0668521ca6e7fab6c106e77f951652
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3db072557b
commit
6a4a867f74
@@ -953,9 +953,8 @@ class JFlipperClient : public jni::HybridClass<JFlipperClient> {
|
||||
securePort,
|
||||
altInsecurePort,
|
||||
altSecurePort});
|
||||
// To switch to a WebSocket provider, uncomment the line below.
|
||||
// facebook::flipper::FlipperSocketProvider::setDefaultProvider(
|
||||
// std::make_unique<JFlipperSocketProvider>());
|
||||
facebook::flipper::FlipperSocketProvider::setDefaultProvider(
|
||||
std::make_unique<JFlipperSocketProvider>());
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -31,9 +31,7 @@ static constexpr int reconnectIntervalSeconds = 2;
|
||||
// To be bumped for every core platform interface change.
|
||||
static constexpr int sdkVersion = 4;
|
||||
|
||||
#ifdef __APPLE__
|
||||
static constexpr int maxFailedSocketConnectionAttempts = 3;
|
||||
#endif
|
||||
|
||||
using namespace folly;
|
||||
|
||||
@@ -477,7 +475,6 @@ void FlipperConnectionManagerImpl::sendLegacyCertificateRequest(
|
||||
WebSocket -> RSocket -> WebSocket -> ...
|
||||
*/
|
||||
void FlipperConnectionManagerImpl::reevaluateSocketProvider() {
|
||||
#ifdef __APPLE__
|
||||
if (failedSocketConnectionAttempts < maxFailedSocketConnectionAttempts) {
|
||||
++failedSocketConnectionAttempts;
|
||||
} else {
|
||||
@@ -490,7 +487,6 @@ void FlipperConnectionManagerImpl::reevaluateSocketProvider() {
|
||||
FlipperSocketProvider::unshelveDefault();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool FlipperConnectionManagerImpl::isRunningInOwnThread() {
|
||||
|
||||
@@ -75,11 +75,7 @@ class FlipperConnectionManagerImpl : public FlipperConnectionManager {
|
||||
int failedConnectionAttempts_ = 0;
|
||||
int failedSocketConnectionAttempts = 0;
|
||||
|
||||
#ifdef __APPLE__
|
||||
bool useLegacySocketProvider = false;
|
||||
#else
|
||||
bool useLegacySocketProvider = true;
|
||||
#endif
|
||||
|
||||
std::shared_ptr<ConnectionContextStore> contextStore_;
|
||||
std::shared_ptr<FlipperConnectionManagerWrapper> implWrapper_;
|
||||
|
||||
Reference in New Issue
Block a user