From f9097017ded6eaf477c4a6362668a9c69d5d3a96 Mon Sep 17 00:00:00 2001 From: Mikael Sand Date: Thu, 21 Feb 2019 12:28:16 -0800 Subject: [PATCH] Don't reconnect inspector if connection refused (#22625) Summary: (Together with a pr to react-devtools) Fixes https://github.com/facebook/react-native/issues/21030 [iOS] [Fixed] - Fix infinite retry loop of inspector Pull Request resolved: https://github.com/facebook/react-native/pull/22625 Differential Revision: D14169392 Pulled By: hramos fbshipit-source-id: 2e301fd9d458598b62399fc61a9859ad29928483 --- React/Inspector/RCTInspectorPackagerConnection.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/React/Inspector/RCTInspectorPackagerConnection.m b/React/Inspector/RCTInspectorPackagerConnection.m index 5d0ed99ab..d3d97d0ea 100644 --- a/React/Inspector/RCTInspectorPackagerConnection.m +++ b/React/Inspector/RCTInspectorPackagerConnection.m @@ -201,7 +201,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) [self abort:@"Websocket exception" withCause:error]; } - if (!_closed) { + if (!_closed && [error code] != ECONNREFUSED) { [self reconnect]; } }