Webserv
|
Synchronous event demultiplexer that wraps Linux epoll for I/O event monitoring. More...
#include <EpollManager.hpp>
Public Member Functions | |
EpollManager () | |
~EpollManager () | |
void | addFd (int fd, uint32_t events) |
void | removeFd (int fd) |
void | modifyFd (int fd, uint32_t events) |
int | waitForEvents (struct epoll_event *events, int max_events, int timeout=-1) |
void | requestShutdown () |
bool | getisShuttingDown () const |
Private Member Functions | |
EpollManager (const EpollManager &other) | |
EpollManager & | operator= (const EpollManager &other) |
Private Attributes | |
int | epollFd_ |
volatile sig_atomic_t | isShuttingDown |
Synchronous event demultiplexer that wraps Linux epoll for I/O event monitoring.
Provides a simplified interface to the epoll system call for detecting when file descriptors are ready for I/O operations without blocking. Acts as the low-level event detection mechanism in the Reactor pattern implementation. By "low-level", it means epoll() is a system call to communnicate with the kernal space from the user space
network::EpollManager::EpollManager | ( | ) |
network::EpollManager::~EpollManager | ( | ) |
|
private |
void network::EpollManager::addFd | ( | int | fd, |
uint32_t | events ) |
bool network::EpollManager::getisShuttingDown | ( | ) | const |
void network::EpollManager::modifyFd | ( | int | fd, |
uint32_t | events ) |
|
private |
void network::EpollManager::removeFd | ( | int | fd | ) |
void network::EpollManager::requestShutdown | ( | ) |
int network::EpollManager::waitForEvents | ( | struct epoll_event * | events, |
int | max_events, | ||
int | timeout = -1 ) |
|
private |
|
private |