KEEL 1.0.0
Minimal C11 HTTP client/server library built on epoll/kqueue/io_uring/poll
Loading...
Searching...
No Matches
Data Fields
KlResolver Struct Reference

Async DNS resolver vtable. More...

#include <resolver.h>

Collaboration diagram for KlResolver:
Collaboration graph
[legend]

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)
 

Detailed Description

Async DNS resolver vtable.

Field Documentation

◆ resolve

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.

◆ cancel

void(* KlResolver::cancel) (KlResolveReq *req)

Cancel an in-flight request. May be called during shutdown.

◆ destroy

void(* KlResolver::destroy) (KlResolver *self)

Destroy the resolver (free any shared state).


The documentation for this struct was generated from the following file: