mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 01:04:06 +00:00
DapInterface: shutdown sockets on Unix
FreeBSD could hang indefinitely when the debug-adapter process terminated because we closed the TCP socket without first calling `shutdown()`. On that platform (and similarly on Linux and macOS) a peer that is still blocked in `recv` will not be woken up unless a full‐duplex shutdown is performed. This patch adds `shutdown(fd, SHUT_RDWR)` in `DapInterface.cpp` for Linux, *BSD, and macOS builds, preventing the observed hang.
This commit is contained in:
@@ -258,9 +258,7 @@ namespace DAP
|
||||
}
|
||||
if (m_ServerSocket != -1)
|
||||
{
|
||||
#if OS_LINUX
|
||||
shutdown(m_ServerSocket, SHUT_RDWR);
|
||||
#endif
|
||||
close(m_ServerSocket);
|
||||
m_ServerSocket = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user