diff --git a/src/event/MultiSocketMonitor.cxx b/src/event/MultiSocketMonitor.cxx index f747fd0f9..98d57332c 100644 --- a/src/event/MultiSocketMonitor.cxx +++ b/src/event/MultiSocketMonitor.cxx @@ -42,6 +42,18 @@ MultiSocketMonitor::Reset() noexcept ready = refresh = false; } +bool +MultiSocketMonitor::AddSocket(SocketDescriptor fd, unsigned events) noexcept +{ + fds.emplace_front(*this, fd); + bool success = fds.front().Schedule(events); + if (!success) { + fds.pop_front(); + } + + return success; +} + void MultiSocketMonitor::ClearSocketList() noexcept { diff --git a/src/event/MultiSocketMonitor.hxx b/src/event/MultiSocketMonitor.hxx index c4bad8ac0..c1d363a29 100644 --- a/src/event/MultiSocketMonitor.hxx +++ b/src/event/MultiSocketMonitor.hxx @@ -145,15 +145,7 @@ public: * * May only be called from PrepareSockets(). */ - bool AddSocket(SocketDescriptor fd, unsigned events) noexcept { - fds.emplace_front(*this, fd); - bool success = fds.front().Schedule(events); - if (!success) { - fds.pop_front(); - } - - return success; - } + bool AddSocket(SocketDescriptor fd, unsigned events) noexcept; /** * Remove all sockets.