Source/ThunderBeast/QuakeToon/platform/net_win_udp.c
// sleeps msec or until net socket is ready
sleeps msec or until net socket is ready
sleeps msec or until net socket is ready
void NET_Sleep(int msec)
{
    struct timeval timeout;
    fd_set  fdset;
    extern cvar_t *dedicated;
    int i;
    if (!dedicated || !dedicated->value)
        return; 
    FD_ZERO(&fdset);
    i = 0;
    if (ip_sockets[NS_SERVER]) {
        FD_SET(ip_sockets[NS_SERVER], &fdset); 
        i = ip_sockets[NS_SERVER];
    }
    if (ipx_sockets[NS_SERVER]) {
        FD_SET(ipx_sockets[NS_SERVER], &fdset); 
        if (ipx_sockets[NS_SERVER] > i)
            i = ipx_sockets[NS_SERVER];
    }
    timeout.tv_sec = msec/1000;
    timeout.tv_usec = (msec%1000)*1000;
    select(i+1, &fdset, NULL, NULL, &timeout);
}
void NET_Sleep ( int msec ) { struct timeval timeout ; fd_set fdset ; extern cvar_t * dedicated ; int i ; if ( ! dedicated || ! dedicated -> value ) return ; FD_ZERO ( & fdset ) ; i = 0 ; if ( ip_sockets [ NS_SERVER ] ) { FD_SET ( ip_sockets [ NS_SERVER ] , & fdset ) ; i = ip_sockets [ NS_SERVER ] ; } if ( ipx_sockets [ NS_SERVER ] ) { FD_SET ( ipx_sockets [ NS_SERVER ] , & fdset ) ; if ( ipx_sockets [ NS_SERVER ] > i ) i = ipx_sockets [ NS_SERVER ] ; } timeout . tv_sec = msec / 1000 ; timeout . tv_usec = ( msec % 1000 ) * 1000 ; select ( i + 1 , & fdset , NULL , NULL , & timeout ) ; }
sleeps msec or until net socket is ready
sleeps msec or until net socket is ready
// we're not a server, just run full speed // network socket // network socket