From d834d6ed0647ba7e51e81f600fe259156e2b8070 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 3 Nov 2013 17:54:07 +0100 Subject: Exit the poller when it handles no connection at all --- src/network/poller.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/network/poller.cpp') 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; } -- cgit v1.2.3