2 #include "globaldefs.h"
10 const int SOCKET_ERROR = -1;
12 #error "unsupported platform"
19 int Net_Wait(socket_t *sock, long sec, long usec)
23 TIMEVAL tout = { sec, usec };
31 // select() will identify if the socket needs an update
32 // if the socket is identified that means there's either a message or the connection has been closed/reset/terminated
35 FD_SET(((unsigned int) sock->socket), &readfds);
36 // from select man page:
37 // n is the highest-numbered descriptor in any of the three sets, plus 1
38 // (no use on windows)
39 switch (select(sock->socket + 1, &readfds, 0, 0, &tout)) {