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 addHandler (IEventHandler *handler, uint32_t events)
void modifyHandler (IEventHandler *handler, uint32_t events)
void removeHandler (IEventHandler const *handler)
int waitForEvents (struct epoll_event *events, int maxEvents, 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 ClientHandler 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

◆ addHandler()

void network::EpollManager::addHandler ( IEventHandler * handler,
uint32_t events )

◆ getisShuttingDown()

bool network::EpollManager::getisShuttingDown ( ) const

◆ modifyHandler()

void network::EpollManager::modifyHandler ( IEventHandler * handler,
uint32_t events )

◆ operator=()

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

◆ removeHandler()

void network::EpollManager::removeHandler ( IEventHandler const * handler)

◆ requestShutdown()

void network::EpollManager::requestShutdown ( )

◆ waitForEvents()

int network::EpollManager::waitForEvents ( struct epoll_event * events,
int maxEvents,
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: