mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-06-17 14:12:25 +00:00
fix closesocketproper on windows
This commit is contained in:
@@ -17,13 +17,8 @@ inline void ZeroMemory(void* dst, size_t len) {
|
|||||||
}
|
}
|
||||||
// provides unix equivalent of closesocket call in win32
|
// provides unix equivalent of closesocket call in win32
|
||||||
inline void CloseSocketProper(int socket) {
|
inline void CloseSocketProper(int socket) {
|
||||||
#ifndef WIN32
|
|
||||||
shutdown(socket, SHUT_RDWR);
|
shutdown(socket, SHUT_RDWR);
|
||||||
close(socket);
|
close(socket);
|
||||||
#else // WIN32
|
|
||||||
shutdown(socket, SD_BOTH);
|
|
||||||
closesocket(socket);
|
|
||||||
#endif // WIN32
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __try
|
#ifndef __try
|
||||||
@@ -34,4 +29,10 @@ inline void CloseSocketProper(int socket) {
|
|||||||
#define __except (x) /**/
|
#define __except (x) /**/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#else // win32
|
||||||
|
|
||||||
|
inline void CloseSocketProper(uint64_t socket) {
|
||||||
|
shutdown(socket, SD_BOTH);
|
||||||
|
closesocket(socket);
|
||||||
|
}
|
||||||
#endif // WIN32
|
#endif // WIN32
|
||||||
|
|||||||
Reference in New Issue
Block a user