forked from Mirrors/openclonk
C4NetIO: mac: To be on the safe side, only activate poll timeout cap when APPLE
parent
f90e67d4ca
commit
d63ea57e5f
|
@ -385,12 +385,14 @@ bool C4NetIOTCP::CloseBroadcast()
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef APPLE
|
||||
static int fix_poll_timeout(int timeout) {
|
||||
if (timeout < 0 || timeout > 1000)
|
||||
return 1000;
|
||||
else
|
||||
return timeout;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool C4NetIOTCP::Execute(int iMaxTime, pollfd *fds) // (mt-safe)
|
||||
{
|
||||
|
@ -407,7 +409,9 @@ bool C4NetIOTCP::Execute(int iMaxTime, pollfd *fds) // (mt-safe)
|
|||
WSANETWORKEVENTS wsaEvents;
|
||||
#else
|
||||
|
||||
#ifdef APPLE
|
||||
iMaxTime = fix_poll_timeout(iMaxTime);
|
||||
#endif
|
||||
|
||||
std::vector<pollfd> fdvec;
|
||||
std::map<SOCKET, const pollfd*> fdmap;
|
||||
|
@ -1520,7 +1524,9 @@ bool C4NetIOSimpleUDP::Execute(int iMaxTime, pollfd *)
|
|||
if (!fInit) { SetError("not yet initialized"); return false; }
|
||||
ResetError();
|
||||
|
||||
#ifdef APPLE
|
||||
iMaxTime = fix_poll_timeout(iMaxTime);
|
||||
#endif
|
||||
|
||||
// wait for socket / timeout
|
||||
WaitResult eWR = WaitForSocket(iMaxTime);
|
||||
|
|
Loading…
Reference in New Issue