1#if !defined(RESIP_SOCKET_HXX)
2#define RESIP_SOCKET_HXX
31#if defined(_MSC_VER) && (_MSC_VER >= 1600)
33#pragma warning (disable: 4005 )
38#define EWOULDBLOCK WSAEWOULDBLOCK
39#define EINPROGRESS WSAEINPROGRESS
40#define EALREADY WSAEALREADY
41#define ENOTSOCK WSAENOTSOCK
42#define EDESTADDRREQ WSAEDESTADDRREQ
43#define EMSGSIZE WSAEMSGSIZE
44#define EPROTOTYPE WSAEPROTOTYPE
45#define ENOPROTOOPT WSAENOPROTOOPT
46#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
47#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
48#define EOPNOTSUPP WSAEOPNOTSUPP
49#define EPFNOSUPPORT WSAEPFNOSUPPORT
50#define EAFNOSUPPORT WSAEAFNOSUPPORT
51#define EADDRINUSE WSAEADDRINUSE
52#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
53#define ENETDOWN WSAENETDOWN
54#define ENETUNREACH WSAENETUNREACH
55#define ENETRESET WSAENETRESET
56#define ECONNABORTED WSAECONNABORTED
57#define ECONNRESET WSAECONNRESET
58#define ENOBUFS WSAENOBUFS
59#define EISCONN WSAEISCONN
60#define ENOTCONN WSAENOTCONN
61#define ESHUTDOWN WSAESHUTDOWN
62#define ETOOMANYREFS WSAETOOMANYREFS
63#define ETIMEDOUT WSAETIMEDOUT
64#define ECONNREFUSED WSAECONNREFUSED
67#define EHOSTDOWN WSAEHOSTDOWN
68#define EHOSTUNREACH WSAEHOSTUNREACH
70#define EPROCLIM WSAEPROCLIM
71#define EUSERS WSAEUSERS
72#define EDQUOT WSAEDQUOT
73#define ESTALE WSAESTALE
74#define EREMOTE WSAEREMOTE
76#if defined(_MSC_VER) && (_MSC_VER >= 1600)
82#define WSANOTINITIALISED EPROTONOSUPPORT
95#define INVALID_SOCKET (-1)
96#define SOCKET_ERROR (-1)
102inline int getErrno() {
return WSAGetLastError(); }
184 tv.tv_sec = (
ms/1000);
185 tv.tv_usec = (
ms%1000)*1000;
#define resip_assert(x)
This file needs to work for both C and C++ code.
Object-oriented wrapper for your platform's file-descriptor set.
bool readyToWrite(Socket fd)
bool readyToRead(Socket fd)
void setExcept(Socket fd)
int selectMilliSeconds(unsigned long ms)
bool hasException(Socket fd)
int select(struct timeval &tv)
This file is used to handle compatibility fixes/tweaks so reSIProcate can function on multiple platfo...
dcm! – add UnusedChecking(_enum) below;
bool makeSocketBlocking(Socket fd)
void(* AfterSocketCreationFuncPtr)(Socket s, int transportType, const char *file, int line)
int getSocketError(Socket fd)
int getSocketDscp(Socket fd, IpVersion version)
The DSCP class of {fd}, which is getSocketTos() without the ECN bits.
int increaseLimitFds(unsigned int targetFds)
Returns negative on error, or number of (positive) allowed fds.
bool configureConnectedSocket(Socket fd)
void initNetwork()
set up network - does nothing in unix but needed for windows
int closeSocket(Socket fd)
int setSocketDscp(Socket fd, int dscp, IpVersion version)
Sets the DSCP class of {fd}, in the IPv4 ToS byte or the IPv6 traffic class, and reads it back.
int setSocketRcvBufLen(Socket fd, int buflen)
int getSocketTos(Socket fd, IpVersion version)
Reads the IPv4 ToS byte, or the IPv6 traffic class, of {fd}.
IpVersion
An enumeration of IP versions.
bool makeSocketNonBlocking(Socket fd)