1 #ifndef WIN32_SOCKET_H 2 #define WIN32_SOCKET_H 3 4 #ifdef __WIN32 5 6 #include <winsock2.h> 7 8 #define ECONNRESET WSAECONNRESET 9 #define EINPROGRESS WSAEINPROGRESS 10 #define EALREADY WSAEALREADY 11 #define ECONNABORTED WSAECONNABORTED 12 #define ioctl ioctlsocket 13 #define hstrerror(x) "" 14 #else 15 #include <sys/socket.h> 16 #include <sys/ioctl.h> 17 #include <netinet/in.h> 18 #include <netinet/tcp.h> 19 #include <sys/un.h> 20 #include <arpa/inet.h> 21 22 #include <netdb.h> 23 #endif 24 25 #endif 26