-void LHNET_SleepUntilPacket_Microseconds(int microseconds)
-{
-#ifdef FD_SET
- fd_set fdreadset;
- struct timeval tv;
- int lastfd;
- lhnetsocket_t *s;
- FD_ZERO(&fdreadset);
- lastfd = 0;
- for (s = lhnet_socketlist.next;s != &lhnet_socketlist;s = s->next)
- {
- if (s->address.addresstype == LHNETADDRESSTYPE_INET4 || s->address.addresstype == LHNETADDRESSTYPE_INET6)
- {
- if (lastfd < s->inetsocket)
- lastfd = s->inetsocket;
-#if defined(WIN32) && !defined(_MSC_VER)
- FD_SET((int)s->inetsocket, &fdreadset);
-#else
- FD_SET((unsigned int)s->inetsocket, &fdreadset);
-#endif
- }
- }
- tv.tv_sec = microseconds / 1000000;
- tv.tv_usec = microseconds % 1000000;
- select(lastfd + 1, &fdreadset, NULL, NULL, &tv);
-#else
- Sys_Sleep(microseconds);
-#endif
-}
-