mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-27 00:00:07 -06:00
Fix gdb break on start & gdb ports not closing after restarting/crashing (#2167)
This commit is contained in:
@ -101,6 +101,15 @@ bool GdbStub::Init()
|
||||
Log(LogLevel::Error, "[GDB] err: can't create a socket fd\n");
|
||||
goto err;
|
||||
}
|
||||
{
|
||||
// Make sure the port can be reused immediately after melonDS stops and/or restarts
|
||||
int enable = 1;
|
||||
#ifdef _WIN32
|
||||
setsockopt(SockFd, SOL_SOCKET, SO_REUSEADDR, (const char*)&enable, sizeof(enable));
|
||||
#else
|
||||
setsockopt(SockFd, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));
|
||||
#endif
|
||||
}
|
||||
#ifndef __linux__
|
||||
SocketSetBlocking(SockFd, false);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user