mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-19 10:08:04 +03:00
Move max socket calculation to proper place
This commit is contained in:
parent
41d62afef0
commit
5d1a416b03
@ -1076,6 +1076,15 @@ DLL_EXPORT int NET_Sleep_Timeout(void)
|
|||||||
fd_set fdset;
|
fd_set fdset;
|
||||||
FD_ZERO(&fdset);
|
FD_ZERO(&fdset);
|
||||||
|
|
||||||
|
struct timeval tv;
|
||||||
|
tv.tv_sec = 0;
|
||||||
|
tv.tv_usec = (1000 / fps) * 1000; // TODO: entirely bad code, fix it completely
|
||||||
|
if (tv.tv_usec <= 0)
|
||||||
|
tv.tv_usec = 1;
|
||||||
|
|
||||||
|
int res;
|
||||||
|
if (numFrames > 0 && numFrames % staggerFrames)
|
||||||
|
{
|
||||||
int number = 0;
|
int number = 0;
|
||||||
|
|
||||||
for (int sock = 0; sock < 3; sock++)
|
for (int sock = 0; sock < 3; sock++)
|
||||||
@ -1100,16 +1109,6 @@ DLL_EXPORT int NET_Sleep_Timeout(void)
|
|||||||
}
|
}
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
}
|
}
|
||||||
|
|
||||||
struct timeval tv;
|
|
||||||
tv.tv_sec = 0;
|
|
||||||
tv.tv_usec = (1000 / fps) * 1000; // TODO: entirely bad code, fix it completely
|
|
||||||
if (tv.tv_usec <= 0)
|
|
||||||
tv.tv_usec = 1;
|
|
||||||
|
|
||||||
int res;
|
|
||||||
if (numFrames > 0 && numFrames % staggerFrames)
|
|
||||||
{
|
|
||||||
res = select(number + 1, &fdset, 0, 0, &tv);
|
res = select(number + 1, &fdset, 0, 0, &tv);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user