mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-11-21 20:01:46 +00:00
Groundwork for an opt-in reactor that parks idle keep-alive connections instead of blocking a worker thread on each of them. detail::Poller delivers readiness once per arm(), so a descriptor is either armed (owned by the poller) or owned by whoever got the event. The same contract maps onto poll(), epoll, kqueue and Windows' AFD_POLL, so a backend can be added without touching its users. wake() ends a wait() from any thread; an armed descriptor must be disarmed before it is closed, which the poll() backend asserts. detail::PollPoller is the portable backend (poll() / WSAPoll()), and detail::create_socket_pair() emulates socketpair() on Windows with sockets that child processes do not inherit. Nothing uses them yet.