void SocketImpl::setSendTimeout(const pi::Timespan& timeout) { #if defined(_WIN32) && !defined(PIL_BROKEN_TIMEOUTS) int value = (int) timeout.totalMilliseconds(); setOption(SOL_SOCKET, SO_SNDTIMEO, value); #elif defined(PIL_BROKEN_TIMEOUTS) _sndTimeout = timeout; #else setOption(SOL_SOCKET, SO_SNDTIMEO, timeout); #endif }
void SocketImpl::setReceiveTimeout(const pi::Timespan& timeout) { #ifndef PIL_BROKEN_TIMEOUTS #if defined(_WIN32) int value = (int) timeout.totalMilliseconds(); setOption(SOL_SOCKET, SO_RCVTIMEO, value); #else setOption(SOL_SOCKET, SO_RCVTIMEO, timeout); #endif #else _recvTimeout = timeout; #endif }