1 #ifndef WIN32_SOCKET_H 2 #define WIN32_SOCKET_H 3 #include "first.h" 4 5 #ifdef __WIN32 6 7 #include <winsock2.h> 8 9 #define ECONNRESET WSAECONNRESET 10 #define EINPROGRESS WSAEINPROGRESS 11 #define EALREADY WSAEALREADY 12 #define ECONNABORTED WSAECONNABORTED 13 14 #else 15 16 #include <sys/socket.h> 17 #include <netinet/in.h> 18 #include <netinet/tcp.h> 19 #ifdef HAVE_SYS_UN_H 20 #include <sys/un.h> 21 #endif 22 23 #endif 24 25 26 #ifndef INET_ADDRSTRLEN 27 #define INET_ADDRSTRLEN 16 28 #endif 29 #ifndef INET6_ADDRSTRLEN 30 #define INET6_ADDRSTRLEN 46 31 #endif 32 #ifndef UNIX_PATH_MAX 33 #define UNIX_PATH_MAX 108 34 #endif 35 36 /* for solaris 2.5 and NetBSD 1.3.x */ 37 #ifndef HAVE_SOCKLEN_T 38 typedef int socklen_t; 39 #endif 40 41 #ifndef SHUT_WR 42 #define SHUT_WR 1 43 #endif 44 45 #endif 46