net: also wait for exceptional events in Sock::Wait()

This mimics closely `CConnman::SocketEvents()` and the underlying
`poll(2)`.
This commit is contained in:
Vasil Dimov
2021-05-04 12:06:44 +02:00
parent e18fd4763e
commit cc74459768
3 changed files with 26 additions and 9 deletions

View File

@@ -150,8 +150,8 @@ bool Session::Accept(Connection& conn)
throw std::runtime_error("wait on socket failed");
}
if ((occurred & Sock::RECV) == 0) {
// Timeout, no incoming connections within MAX_WAIT_FOR_IO.
if (occurred == 0) {
// Timeout, no incoming connections or errors within MAX_WAIT_FOR_IO.
continue;
}