aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2019-03-09 02:30:05 +0100
committerArisotura <thetotalworm@gmail.com>2019-03-09 02:30:05 +0100
commit9485a4e8c0a603f696443de6d280445f53627e3a (patch)
treef8eb72982fdd1f64303bc15d03a759b8b983bcc2
parent7d2b3bbf76255820e2fe8464429e25c2cc92e6f9 (diff)
properly close sockets, so that they can be reused
-rw-r--r--src/libui_sdl/LAN_Socket.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libui_sdl/LAN_Socket.cpp b/src/libui_sdl/LAN_Socket.cpp
index c3ad991..373f539 100644
--- a/src/libui_sdl/LAN_Socket.cpp
+++ b/src/libui_sdl/LAN_Socket.cpp
@@ -766,9 +766,12 @@ void HandleTCPFrame(u8* data, int len)
if (flags & 0x001) // FIN
{
- // TODO: cleverer termination?
- // also timeout etc
+ // TODO: timeout etc
+ printf("TCP: socket %d closing\n", sockid);
+
sock->Status = 0;
+ closesocket(sock->Backend);
+ sock->Backend = 0;
}
}
}