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