socket_proxy.cpp: Add Mutex & Flush for Socket Protection

Signed-off-by: Collecting <collecting@noreply.localhost>
This commit is contained in:
Collecting
2026-01-14 19:37:29 +00:00
parent 5a7a9c9bb8
commit 4f149e130c

View File

@@ -307,9 +307,15 @@ std::pair<s32, Errno> ProxySocket::SendTo(u32 flags, std::span<const u8> message
}
Errno ProxySocket::Close() {
std::lock_guard guard(packets_mutex);
fd = INVALID_SOCKET;
closed = true;
// Flush any pending packets so they don't get processed after closure
while (!received_packets.empty()) {
received_packets.pop();
}
return Errno::SUCCESS;
}