29 data.events |= POLLIN;
30 data_.push_back(
data);
36 if (timeout_usec >= 1000000) {
38 " one million microseconds");
42 timeout = timeout_sec * 1000 + timeout_usec / 1000;
45 for (
size_t i = 0; i < data_.size(); ++i) {
46 map_[data_[i].fd] = &data_[i];
48 return (poll(data_.data(), data_.size(), timeout));
55 if (map_.find(fd) == map_.end()) {
58 return (map_[fd]->revents & (POLLIN | POLLHUP));
66 if (map_.find(fd) == map_.end()) {
69 return (map_[fd]->revents & POLLERR);
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
FDEventHandler(HandlerType type=TYPE_UNKNOWN)
Constructor.
void add(int fd)
Add file descriptor to watch for events.
virtual bool hasError(int fd)
Check if file descriptor has error.
bool readReady(int fd)
Check if file descriptor is ready for read operation.
int waitEvent(uint32_t timeout_sec, uint32_t timeout_usec=0, bool use_timeout=true)
Wait for events on registered file descriptors.
PollEventHandler()
Constructor.
void clear()
Clear registered file descriptors.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Defines the logger used by the top-level component of kea-lfc.