mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-11-21 20:01:46 +00:00
Add a kqueue poller for keep-alive parking on macOS and FreeBSD
KqueuePoller keeps the Poller contract with EV_ONESHOT, which deletes an event once it is delivered, so arm() adds it each time. wake() uses the socket pair that PollPoller uses, since EVFILT_USER is not on every BSD. make_poller() picks it on macOS and FreeBSD and falls back to poll() elsewhere. The contract tests now run on it as well.
This commit is contained in:
1 parent
f92079e633
commit
ddaeb5d83d
2 files changed
+115
-1
No files matched your search
@@ -33938,6 +33938,9 @@ std::vector<PollerBackend> poller_backends() {
|
||||
{"poll", &detail::PollPoller::create},
|
||||
#ifdef __linux__
|
||||
{"epoll", &detail::EpollPoller::create},
|
||||
#endif
|
||||
#ifdef CPPHTTPLIB_KQUEUE_POLLER
|
||||
{"kqueue", &detail::KqueuePoller::create},
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user