| 181 | } |
| 182 | |
| 183 | void clear() |
| 184 | { |
| 185 | for (const auto& entry : sockets) |
| 186 | { |
| 187 | // Since epoll automatically removes registered fds when we close them treat ENOENT and EBADF as non-errors |
| 188 | if ((epoll_ctl(epollHandle, EPOLL_CTL_DEL, entry.handle, nullptr) < 0) && (errno != ENOENT) && (errno != EBADF)) |
| 189 | err() << "Failed to remove socket handle from epoll" << std::endl; |
| 190 | } |
| 191 | sockets.clear(); |
| 192 | } |
| 193 | |
| 194 | bool wait(Time timeout) |
| 195 | { |