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:
trompetin17
2025-07-14 12:30:32 -05:00
parent 8f9c92f30c
commit b2fc1d6943
-2
View File
@@ -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;
}