Webserv
Loading...
Searching...
No Matches
network::EpollManager Class Reference

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)
EpollManageroperator= (const EpollManager &other)

Private Attributes

int epollFd_
volatile sig_atomic_t isShuttingDown

Detailed Description

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

Constructor & Destructor Documentation

◆ EpollManager() [1/2]

network::EpollManager::EpollManager ( )

◆ ~EpollManager()

network::EpollManager::~EpollManager ( )

◆ EpollManager() [2/2]

network::EpollManager::EpollManager ( const EpollManager & other)
private

Member Function Documentation

◆ addFd()

void network::EpollManager::addFd ( int fd,
uint32_t events )

◆ getisShuttingDown()

bool network::EpollManager::getisShuttingDown ( ) const

◆ modifyFd()

void network::EpollManager::modifyFd ( int fd,
uint32_t events )

◆ operator=()

EpollManager & network::EpollManager::operator= ( const EpollManager & other)
private

◆ removeFd()

void network::EpollManager::removeFd ( int fd)

◆ requestShutdown()

void network::EpollManager::requestShutdown ( )

◆ waitForEvents()

int network::EpollManager::waitForEvents ( struct epoll_event * events,
int max_events,
int timeout = -1 )

Member Data Documentation

◆ epollFd_

int network::EpollManager::epollFd_
private

◆ isShuttingDown

volatile sig_atomic_t network::EpollManager::isShuttingDown
private

The documentation for this class was generated from the following files: