11#include <promeki/config.h>
23PROMEKI_NAMESPACE_BEGIN
91 using UPtr = UniquePtr<SrtEpoll>;
94 static constexpr int InvalidId = -1;
112 using ReadyList = ::promeki::List<Ready>;
123 using ReadyCallback = Function<void(
int events)>;
131 SrtEpoll(
const SrtEpoll &) =
delete;
132 SrtEpoll &operator=(
const SrtEpoll &) =
delete;
150 bool isOpen()
const {
return _eid != InvalidId; }
159 Error add(SrtSocket &sock,
int events);
172 Error add(SrtServer &server,
int events);
180 Error modify(SrtSocket &sock,
int events);
187 Error remove(SrtSocket &sock);
190 Error remove(SrtServer &server);
203 int wait(ReadyList &ready,
int timeoutMs);
211 int handle()
const {
return _eid; }
227 Error setCallback(SrtSocket &sock, ReadyCallback cb);
230 Error setCallback(SrtServer &server, ReadyCallback cb);
248 int dispatchOnce(
int timeoutMs);
272 int _eid = InvalidId;
273 Map<int, ReadyCallback> _callbacks;
274 Atomic<bool> _stopRequested{
false};