mirror of
https://github.com/ioquake/ioq3.git
synced 2024-11-10 07:11:46 +00:00
- Have NET_Sleep work with Windows' INVALID_SOCKET again...
- Use SOCKET_ERROR in NET_Sleep.
This commit is contained in:
parent
725c9df608
commit
3b09685b42
1 changed files with 8 additions and 8 deletions
|
@ -1673,13 +1673,10 @@ void NET_Sleep(int msec)
|
|||
{
|
||||
FD_SET(ip6_socket, &fdr);
|
||||
|
||||
if(ip6_socket > highestfd)
|
||||
if(highestfd == INVALID_SOCKET || ip6_socket > highestfd)
|
||||
highestfd = ip6_socket;
|
||||
}
|
||||
|
||||
timeout.tv_sec = msec/1000;
|
||||
timeout.tv_usec = (msec%1000)*1000;
|
||||
|
||||
#ifdef _WIN32
|
||||
if(highestfd == INVALID_SOCKET)
|
||||
{
|
||||
|
@ -1689,9 +1686,12 @@ void NET_Sleep(int msec)
|
|||
}
|
||||
#endif
|
||||
|
||||
timeout.tv_sec = msec/1000;
|
||||
timeout.tv_usec = (msec%1000)*1000;
|
||||
|
||||
retval = select(highestfd + 1, &fdr, NULL, NULL, &timeout);
|
||||
|
||||
if(retval < 0)
|
||||
if(retval == SOCKET_ERROR)
|
||||
Com_Printf("Warning: select() syscall failed: %s\n", NET_ErrorString());
|
||||
else if(retval > 0)
|
||||
NET_Event(&fdr);
|
||||
|
|
Loading…
Reference in a new issue