Infer socket readiness from select() return value.

This commit is contained in:
Bartosz Taudul 2018-07-16 01:50:21 +02:00
parent 807d2a02bc
commit 3799e0da43

View File

@ -233,8 +233,7 @@ bool Socket::HasData()
FD_ZERO( &fds ); FD_ZERO( &fds );
FD_SET( m_sock, &fds ); FD_SET( m_sock, &fds );
select( m_sock+1, &fds, nullptr, nullptr, &tv ); return select( m_sock+1, &fds, nullptr, nullptr, &tv ) > 0;
return FD_ISSET( m_sock, &fds );
} }