BioInt
1.02.00
BioInt: An integrative biological object-oriented application framework and interpreter
|
00001 #ifndef BIOSOCKETCOMMON_H 00002 #define BIOSOCKETCOMMON_H 1 00003 00004 00005 #ifdef WIN32 00006 #include <winsock2.h> 00007 typedef unsigned socket_type; 00008 #else 00009 // *nix 00010 00011 #include <sys/types.h> 00012 #include <sys/socket.h> 00013 #include <netdb.h> 00014 #include <netinet/in.h> 00015 #include <arpa/inet.h> 00016 #include <unistd.h> 00017 #include <netinet/tcp.h> 00018 #include <sys/ioctl.h> 00019 #include <errno.h> 00020 00021 typedef int socket_type; 00022 00023 #ifndef INVALID_SOCKET 00024 # define INVALID_SOCKET -1 00025 #endif 00026 #ifndef SOCKET_ERROR 00027 # define SOCKET_ERROR -1 00028 #endif 00029 00030 // let's define here all the BSD socket possible errors as Winsock defines 00031 00032 00033 #define WSAEINTR EINTR 00034 #define WSAEBADF EBADF 00035 #define WSAEACCES EACCES 00036 #define WSAEFAULT EFAULT 00037 #define WSAEINVAL EINVAL 00038 #define WSAEMFILE EMFILE 00039 #define WSAEWOULDBLOCK EWOULDBLOCK 00040 #define WSAEINPROGRESS EINPROGRESS 00041 #define WSAEALREADY EALREADY 00042 #define WSAENOTSOCK ENOTSOCK 00043 #define WSAEDESTADDRREQ EDESTADDRREQ 00044 #define WSAEMSGSIZE EMSGSIZE 00045 #define WSAEPROTOTYPE EPROTOTYPE 00046 #define WSAENOPROTOOPT ENOPROTOOPT 00047 #define WSAEPROTONOSUPPORT EPROTONOSUPPORT 00048 #define WSAESOCKTNOSUPPORT ESOCKTNOSUPPORT 00049 #define WSAEOPNOTSUPP EOPNOTSUPP 00050 #define WSAEPFNOSUPPORT EPFNOSUPPORT 00051 #define WSAEAFNOSUPPORT EAFNOSUPPORT 00052 #define WSAEADDRINUSE EADDRINUSE 00053 #define WSAEADDRNOTAVAIL EADDRNOTAVAIL 00054 #define WSAENETDOWN ENETDOWN 00055 #define WSAENETUNREACH ENETUNREACH 00056 #define WSAENETRESET ENETRESET 00057 #define WSAECONNABORTED ECONNABORTED 00058 #define WSAECONNRESET ECONNRESET 00059 #define WSAENOBUFS ENOBUFS 00060 #define WSAEISCONN EISCONN 00061 #define WSAENOTCONN ENOTCONN 00062 #define WSAESHUTDOWN ESHUTDOWN 00063 #define WSAETOOMANYREFS ETOOMANYREFS 00064 #define WSAETIMEDOUT ETIMEDOUT 00065 #define WSAECONNREFUSED ECONNREFUSED 00066 #define WSAELOOP ELOOP 00067 #define WSAENAMETOOLONG ENAMETOOLONG 00068 #define WSAEHOSTDOWN EHOSTDOWN 00069 #define WSAEHOSTUNREACH EHOSTUNREACH 00070 #define WSAHOST_NOT_FOUND HOST_NOT_FOUND 00071 #define WSATRY_AGAIN TRY_AGAIN 00072 #define WSANO_RECOVERY NO_RECOVERY 00073 #define WSANO_DATA NO_DATA 00074 00075 #endif 00076 00077 00078 #ifdef WIN32 00079 extern int __WinSock_dummy_int; 00080 00081 namespace { 00082 int __other_dummy = __WinSock_dummy_int; 00083 }; 00084 #endif // WIN32 00085 00086 #endif