From b57da3c393ab75b46dfceb14b0c28cb75c743a94 Mon Sep 17 00:00:00 2001 From: Sara Itani Date: Thu, 22 Oct 2015 09:06:47 -0700 Subject: [PATCH] #466 Debugger does not start reliably running Node.js console app - always try to attach once, even if Close has already been called. --- .../Nodejs/Debugger/Communication/DebuggerConnection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nodejs/Product/Nodejs/Debugger/Communication/DebuggerConnection.cs b/Nodejs/Product/Nodejs/Debugger/Communication/DebuggerConnection.cs index 30d6cd5e8..d46afc922 100644 --- a/Nodejs/Product/Nodejs/Debugger/Communication/DebuggerConnection.cs +++ b/Nodejs/Product/Nodejs/Debugger/Communication/DebuggerConnection.cs @@ -122,7 +122,7 @@ public void Connect(Uri uri) { lock (_networkClientLock) { int connection_attempts = 0; const int MAX_ATTEMPTS = 5; - while (!_isClosed) { + while (true) { connection_attempts++; try { // TODO: This currently results in a call to the synchronous TcpClient @@ -147,7 +147,7 @@ public void Connect(Uri uri) { throw; } LiveLogger.WriteLine("Connection attempt {0} failed with: {1}", connection_attempts, ex); - if (connection_attempts >= MAX_ATTEMPTS) { + if (connection_attempts >= MAX_ATTEMPTS && !_isClosed) { throw; } else {