COROIO: coroio/backends/epoll.hpp Source File
COROIO
 
Loading...
Searching...
No Matches
epoll.hpp
1#pragma once
2
3#ifdef __linux__
4#include <sys/epoll.h>
5#include <unistd.h>
6#endif
7
8#ifdef _WIN32
9#include <coroio/backends/wepoll.h>
10#endif
11
12#include <coroio/base.hpp>
13#include <coroio/poller.hpp>
14#include <coroio/socket.hpp>
15
16namespace NNet {
17
40class TEPoll: public TPollerBase {
41public:
46
61 void Poll();
62
63private:
64#ifdef __linux__
65 int Fd_;
66#endif
67
68#ifdef _WIN32
69 HANDLE Fd_;
70#endif
71
72 std::vector<THandlePair> InEvents_;
73 std::vector<epoll_event> OutEvents_;
74};
75
76} // namespace NNet
Linux-specific poller implementation using epoll.
Definition epoll.hpp:40
~TEPoll()
Destructs the TEPoll instance and cleans up resources.
TEPoll()
Constructs the TEPoll instance.
void Poll()
Polls for I/O events using the epoll API.
Asynchronous file handle that owns its file descriptor.
Definition socket.hpp:317
Base class for pollers managing asynchronous I/O events and timers.
Definition poller.hpp:52
High-level asynchronous socket for network communication.
Definition socket.hpp:364