mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-10-25 07:34:25 +00:00
gdb: Catch SocketException from TcpListener#Start
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.Debugger.Gdb;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
@@ -9,11 +10,21 @@ namespace Ryujinx.HLE.Debugger
|
||||
{
|
||||
public partial class Debugger
|
||||
{
|
||||
private void DebuggerThreadMain()
|
||||
private void MainLoop()
|
||||
{
|
||||
IPEndPoint endpoint = new(IPAddress.Any, GdbStubPort);
|
||||
_listenerSocket = new TcpListener(endpoint);
|
||||
_listenerSocket.Start();
|
||||
|
||||
try
|
||||
{
|
||||
_listenerSocket.Start();
|
||||
}
|
||||
catch (SocketException se)
|
||||
{
|
||||
Logger.Notice.Print(LogClass.GdbStub, $"Failed to create TCP client for GDB client: {Enum.GetName(se.SocketErrorCode)}");
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.Notice.Print(LogClass.GdbStub, $"Currently waiting on {endpoint} for GDB client");
|
||||
|
||||
while (!_shuttingDown)
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Ryujinx.HLE.Debugger
|
||||
|
||||
ARMeilleure.Optimizations.EnableDebugging = true;
|
||||
|
||||
_debuggerThread = new Thread(DebuggerThreadMain);
|
||||
_debuggerThread = new Thread(MainLoop);
|
||||
_debuggerThread.Start();
|
||||
_messageHandlerThread = new Thread(MessageHandlerMain);
|
||||
_messageHandlerThread.Start();
|
||||
|
||||
Reference in New Issue
Block a user