mirror of
https://git.citron-emu.org/citron/emulator
synced 2026-01-30 14:33:29 +00:00
socket_proxy.cpp: Add Mutex & Flush for Socket Protection
Signed-off-by: Collecting <collecting@noreply.localhost>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user