From 73e921bafc6c518c6b7d295caa7c51214a88b617 Mon Sep 17 00:00:00 2001 From: John Knox Date: Tue, 18 Dec 2018 12:20:50 -0800 Subject: [PATCH] Disable iOS portforwarder Summary: Disabling the port fordwarder. On physical devices, when flipper isn't running and they don't have any certificates, they attempt to connect to the desktop. They always connect to the portforwarder, even though it doesn't connect to flipper desktop. After connecting to the portforwarder, they then try to generate the SSL certs. This is a CPU intensive operation and happens repeatedly in this condition when it really shouldn't be, causing high cpu usage. Disabling for now. The fix will be to make sure that they only do that generation when they are fully connected. Reviewed By: priteshrnandgaonkar Differential Revision: D13507353 fbshipit-source-id: a858a5da7352228b063150334ea443130763d888 --- iOS/FlipperKit/FlipperClient.mm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/iOS/FlipperKit/FlipperClient.mm b/iOS/FlipperKit/FlipperClient.mm index df9bcd00c..dd09d7675 100644 --- a/iOS/FlipperKit/FlipperClient.mm +++ b/iOS/FlipperKit/FlipperClient.mm @@ -28,8 +28,8 @@ using WrapperPlugin = facebook::flipper::FlipperCppWrapperPlugin; folly::ScopedEventBaseThread sonarThread; folly::ScopedEventBaseThread connectionThread; #if !TARGET_OS_SIMULATOR - FKPortForwardingServer *_secureServer; - FKPortForwardingServer *_insecureServer; +// FKPortForwardingServer *_secureServer; +// FKPortForwardingServer *_insecureServer; #endif } @@ -120,12 +120,12 @@ using WrapperPlugin = facebook::flipper::FlipperCppWrapperPlugin; - (void)start; { #if !TARGET_OS_SIMULATOR - _secureServer = [FKPortForwardingServer new]; - [_secureServer forwardConnectionsFromPort:8088]; - [_secureServer listenForMultiplexingChannelOnPort:8078]; - _insecureServer = [FKPortForwardingServer new]; - [_insecureServer forwardConnectionsFromPort:8089]; - [_insecureServer listenForMultiplexingChannelOnPort:8079]; +// _secureServer = [FKPortForwardingServer new]; +// [_secureServer forwardConnectionsFromPort:8088]; +// [_secureServer listenForMultiplexingChannelOnPort:8078]; +// _insecureServer = [FKPortForwardingServer new]; +// [_insecureServer forwardConnectionsFromPort:8089]; +// [_insecureServer listenForMultiplexingChannelOnPort:8079]; #endif _cppClient->start(); } @@ -135,10 +135,10 @@ using WrapperPlugin = facebook::flipper::FlipperCppWrapperPlugin; { _cppClient->stop(); #if !TARGET_OS_SIMULATOR - [_secureServer close]; - _secureServer = nil; - [_insecureServer close]; - _insecureServer = nil; +// [_secureServer close]; +// _secureServer = nil; +// [_insecureServer close]; +// _insecureServer = nil; #endif }