shutdown the socket on linux as well

This commit is contained in:
Lion Kortlepel
2020-11-12 02:31:11 +01:00
parent 7a5861a917
commit d44aa86ed1
2 changed files with 3 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
#include "CustomAssert.h"
#include <cstring>
#include <unistd.h>
#include <sys/socket.h>
// ZeroMemory is just a {0} or a memset(addr, 0, len), and it's a macro on MSVC
inline void ZeroMemory(void* dst, size_t len) {
@@ -16,6 +17,7 @@ inline void ZeroMemory(void* dst, size_t len) {
}
// provides unix equivalent of closesocket call in win32
inline void closesocket(int socket) {
shutdown(socket, SHUT_RDWR);
close(socket);
}