event/MultiSocketMonitor: un-inline AddSocket()
This commit is contained in:
parent
dcbb9fe07c
commit
7764719513
@ -42,6 +42,18 @@ MultiSocketMonitor::Reset() noexcept
|
|||||||
ready = refresh = false;
|
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
|
void
|
||||||
MultiSocketMonitor::ClearSocketList() noexcept
|
MultiSocketMonitor::ClearSocketList() noexcept
|
||||||
{
|
{
|
||||||
|
@ -145,15 +145,7 @@ public:
|
|||||||
*
|
*
|
||||||
* May only be called from PrepareSockets().
|
* May only be called from PrepareSockets().
|
||||||
*/
|
*/
|
||||||
bool AddSocket(SocketDescriptor fd, unsigned events) noexcept {
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove all sockets.
|
* Remove all sockets.
|
||||||
|
Loading…
Reference in New Issue
Block a user