|
KEEL 1.0.0
Minimal C11 HTTP client/server library built on epoll/kqueue/io_uring/poll
|
Async DNS resolver vtable. More...
#include <resolver.h>

Data Fields | |
| KlResolveReq *(* | resolve )(KlResolver *self, KlEventCtx *ctx, const char *host, int port, KlResolveDoneFn done_fn, void *user_data) |
| void(* | cancel )(KlResolveReq *req) |
| void(* | destroy )(KlResolver *self) |
Async DNS resolver vtable.
| KlResolveReq *(* KlResolver::resolve) (KlResolver *self, KlEventCtx *ctx, const char *host, int port, KlResolveDoneFn done_fn, void *user_data) |
Start async name resolution. Must not block. Returns a KlResolveReq handle (resolver-owned), or NULL on error. Calls done_fn on the event loop thread when resolution completes.
Sync completion: resolve() MAY call done_fn synchronously (inside the call, before returning). Decorators that wrap another resolver must handle this — the inner resolver's done_fn may fire before inner->resolve() returns. Use an in_resolve/completed sentinel to detect sync completion and defer freeing the per-request handle. See resolver_cache.c for the canonical implementation of this pattern.
| void(* KlResolver::cancel) (KlResolveReq *req) |
Cancel an in-flight request. May be called during shutdown.
| void(* KlResolver::destroy) (KlResolver *self) |
Destroy the resolver (free any shared state).