Skip to content

Commit

Permalink
Merge pull request #618 from WildernessLabs/alexischr-fix-debug-recon…
Browse files Browse the repository at this point in the history
…nect-vswin

Fix debug reconnect on VSWin extension/.NET Framework. Seems like IOE…
  • Loading branch information
adrianstevens authored Jan 31, 2025
2 parents 79acced + 5d60d3c commit ad30ffe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ async Task ReOpen() // local function
}
goto read;
}
catch (IOException)
{
if (AggressiveReconnectEnabled)
{
Debug.WriteLine("Aggressively re-connecting");
await ReOpen();
}
goto read;
}

Debug.WriteLine($"Received {receivedLength} bytes");

Expand Down
5 changes: 3 additions & 2 deletions Source/Meadow.HCom/Connections/SerialConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1253,11 +1253,12 @@ public override async Task<DebuggingServer> StartDebuggingSession(int port, ILog

var debuggingServer = new DebuggingServer(this, port, logger);

Debug.WriteLine("Tell the Debugging Server to Start Listening");
Debug.WriteLine("You can now connect the debugger client to the local tunnel port");
await debuggingServer.StartListening(cancellationToken);

Debug.WriteLine($"Start Debugging on port: {port}");
Debug.WriteLine($"Debugger client is connected!!! Port: {port}");
await Device.StartDebugging(port, logger, cancellationToken);
Debug.WriteLine("Debugging has fully started!!");

return debuggingServer;
}
Expand Down

0 comments on commit ad30ffe

Please sign in to comment.