COROIO: coroio/kqueue.hpp Source File
COROIO
 
Loading...
Searching...
No Matches
kqueue.hpp
1#pragma once
2
3#include <sys/types.h>
4#include <sys/event.h>
5#include <sys/time.h>
6
7#include "poller.hpp"
8#include "socket.hpp"
9
10namespace NNet {
11
36class TKqueue: public TPollerBase {
37public:
60 void Poll();
61
62private:
63 int Fd_;
64 std::vector<THandlePair> InEvents_;
65 std::vector<struct kevent> ChangeList_;
66 std::vector<struct kevent> OutEvents_;
67};
68
69} // namespace NNet
Asynchronous file handle that owns its file descriptor.
Definition socket.hpp:317
NNet::TFileHandle TFileHandle
Alias for the file handle type.
Definition kqueue.hpp:41
~TKqueue()
Destroys the TKqueue instance.
void Poll()
Polls for I/O events using kqueue.
NNet::TSocket TSocket
Alias for the socket type.
Definition kqueue.hpp:39
TKqueue()
Constructs the TKqueue instance.
TPollerBase()=default
Default constructor.
High-level asynchronous socket for network communication.
Definition socket.hpp:364