Webserv
Loading...
Searching...
No Matches
EpollManager.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <signal.h>
4#include <stdint.h>
5#include <sys/epoll.h>
6
7namespace network {
8
9class IEventHandler;
10
20public:
23
24 void addHandler(IEventHandler *handler, uint32_t events);
25 void modifyHandler(IEventHandler *handler, uint32_t events);
26 void removeHandler(IEventHandler const *handler);
27
28 int waitForEvents(struct epoll_event *events, int maxEvents, int timeout = -1);
29
30 void requestShutdown();
31 bool getisShuttingDown() const;
32
33private:
35 volatile sig_atomic_t isShuttingDown;
36
39};
40
41} // namespace network
void requestShutdown()
Definition EpollManager.cpp:61
void addHandler(IEventHandler *handler, uint32_t events)
Definition EpollManager.cpp:26
EpollManager()
Definition EpollManager.cpp:12
volatile sig_atomic_t isShuttingDown
Definition EpollManager.hpp:35
int waitForEvents(struct epoll_event *events, int maxEvents, int timeout=-1)
Definition EpollManager.cpp:57
int epollFd_
Definition EpollManager.hpp:34
EpollManager(const EpollManager &other)
void removeHandler(IEventHandler const *handler)
Definition EpollManager.cpp:48
~EpollManager()
Definition EpollManager.cpp:20
void modifyHandler(IEventHandler *handler, uint32_t events)
Definition EpollManager.cpp:37
EpollManager & operator=(const EpollManager &other)
bool getisShuttingDown() const
Definition EpollManager.cpp:63
Abstract base class defining the interface for event-driven service handlers.
Definition IEventHandler.hpp:19
Definition Request.hpp:13