From 270cca40aca9710ead7c02d8e952875aa0750e5b Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Thu, 12 Nov 2020 23:39:04 +0100 Subject: [PATCH] fix closesocketproper on windows --- include/UnixCompat.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/UnixCompat.h b/include/UnixCompat.h index 65c887b..f9cab8f 100644 --- a/include/UnixCompat.h +++ b/include/UnixCompat.h @@ -17,13 +17,8 @@ inline void ZeroMemory(void* dst, size_t len) { } // provides unix equivalent of closesocket call in win32 inline void CloseSocketProper(int socket) { -#ifndef WIN32 shutdown(socket, SHUT_RDWR); close(socket); -#else // WIN32 - shutdown(socket, SD_BOTH); - closesocket(socket); -#endif // WIN32 } #ifndef __try @@ -34,4 +29,10 @@ inline void CloseSocketProper(int socket) { #define __except (x) /**/ #endif +#else // win32 + +inline void CloseSocketProper(uint64_t socket) { + shutdown(socket, SD_BOTH); + closesocket(socket); +} #endif // WIN32