8 #define SOCKET_ERROR -1
10 #error "unsupported platform"
17 int Net_Wait(socket_t *sock, long sec, long usec)
21 TIMEVAL tout = { sec, usec };
29 // select() will identify if the socket needs an update
30 // if the socket is identified that means there's either a message or the connection has been closed/reset/terminated
33 FD_SET(((unsigned int)sock->socket), &readfds);
34 // from select man page:
35 // n is the highest-numbered descriptor in any of the three sets, plus 1
36 // (no use on windows)
37 switch( select( sock->socket + 1, &readfds, 0, 0, &tout ) )