diff options
Diffstat (limited to 'src/network/poller.cpp')
-rw-r--r-- | src/network/poller.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/poller.cpp b/src/network/poller.cpp index 7ab8bc3..6e86891 100644 --- a/src/network/poller.cpp +++ b/src/network/poller.cpp @@ -89,9 +89,11 @@ void Poller::stop_watching_send_events(const SocketHandler* const socket_handler throw std::runtime_error("Cannot watch a non-registered socket for send events"); } -void Poller::poll() +bool Poller::poll() { #if POLLER == POLL + if (this->nfds == 0) + return false; int res = ::poll(this->fds, this->nfds, -1); if (res < 0) { @@ -119,4 +121,5 @@ void Poller::poll() } } #endif + return true; } |