diff --git a/src/network/C4NetIO.cpp b/src/network/C4NetIO.cpp index 45980b024..05eabad30 100644 --- a/src/network/C4NetIO.cpp +++ b/src/network/C4NetIO.cpp @@ -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 fdvec; std::map 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);