From 079712f96e83407b3eb4a21f505a190d18946825 Mon Sep 17 00:00:00 2001 From: Mikael Sand Date: Thu, 13 Dec 2018 00:51:03 +0200 Subject: [PATCH] Don't reconnect inspector if connection refused (Together with a pr to react-devtools) Fixes https://github.com/facebook/react-native/issues/21030 --- 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 5d0ed99ab468d0..d3d97d0eaf6097 100644 --- a/React/Inspector/RCTInspectorPackagerConnection.m +++ b/React/Inspector/RCTInspectorPackagerConnection.m @@ -201,7 +201,7 @@ - (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error [self abort:@"Websocket exception" withCause:error]; } - if (!_closed) { + if (!_closed && [error code] != ECONNREFUSED) { [self reconnect]; } }