diff --git a/Libraries/WebSocket/RCTReconnectingWebSocket.m b/Libraries/WebSocket/RCTReconnectingWebSocket.m index 98480838399d44..57e9071b652de9 100644 --- a/Libraries/WebSocket/RCTReconnectingWebSocket.m +++ b/Libraries/WebSocket/RCTReconnectingWebSocket.m @@ -163,7 +163,9 @@ - (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket - (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error { [_delegate reconnectingWebSocketDidClose:self]; - [self reconnect]; + if ([error code] != ECONNREFUSED) { + [self reconnect]; + } } - (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean