diff options
author | Florent Le Coz <louiz@louiz.org> | 2013-11-03 17:54:07 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2013-11-03 17:55:23 +0100 |
commit | d834d6ed0647ba7e51e81f600fe259156e2b8070 (patch) | |
tree | 4b7b63648e788fc3e1c4f68457c3f3a8baa3cd6d /src/network/poller.cpp | |
parent | f2f94618fcf87b4fc1ad86902c63a7a48be745b8 (diff) | |
download | biboumi-d834d6ed0647ba7e51e81f600fe259156e2b8070.tar.gz biboumi-d834d6ed0647ba7e51e81f600fe259156e2b8070.tar.bz2 biboumi-d834d6ed0647ba7e51e81f600fe259156e2b8070.tar.xz biboumi-d834d6ed0647ba7e51e81f600fe259156e2b8070.zip |
Exit the poller when it handles no connection at all
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; } |