#pragma once // ======================= UNIX ======================== #ifdef __unix #include #include #include #include char _getch(); inline void CloseSocketProper(int TheSocket) { shutdown(TheSocket, SHUT_RDWR); close(TheSocket); } #endif // unix // ======================= WIN32 ======================= #ifdef WIN32 #include #include inline void CloseSocketProper(SOCKET TheSocket) { shutdown(TheSocket, 2); // 2 == SD_BOTH closesocket(TheSocket); } #endif // WIN32 // ======================= OTHER ======================= #if !defined(WIN32) && !defined(__unix) #error "OS not supported" #endif