radcli_ctx_dispatch(3)

📦 version 2.0.1, in arch rolling

💅 radcli_ctx_dispatch — ok so here's the whole vibe (radcli manual, section 3)

✨ NAME ✨

radcli_ctx_dispatch — reads whatever's ready on ctx's descriptor(s), validates it, and invokes the registered handler for anything that passes (peep radcli_dae_set_handler() for that part). Also: it drains any in-flight RADCLI_REQUEST_SENDONLY exchange's reply and services its retransmit/timeout deadline (that's net2.md's REQ-NET2-SEND-013/016 bestie), and, once it's due, it sends the RFC 5997 watchdog on an established RadSec session (watchdog.md's REQ-WATCHDOG-NET-001) — and it does all of that unconditionally, every single call, no cap, regardless of whether an active radcli_dae even exists. Like… this is now the single entry point that radcli_ctx_get_poll() drives, for everything ctx owns. Not a DAE-only call anymore, periodt. 👑


🦋 SYNOPSIS 🦋

#include <radcli/>

int radcli_ctx_dispatch(
    radcli_ctx  *ctx
);

🌸 DESCRIPTION 🌸

Okay so on the DAE side specifically: it reads exactly one datagram per call (non-blocking, natch), so a burst of requests re-arms the caller's loop instead of starving it 😌 — and then it runs that datagram through process_packet()'s validation pipeline before ever invoking the registered handler. The way every rejection short of "authorized sender" is just… silent 🙈: no reply, no Error-Cause, no log of the secret or either authenticator (REQ-DAE-SEC-009). Iconic and security-conscious, we love to see it.

Not reentrant, bestie. Calling this, radcli_dae_start(), or radcli_dae_free() from within a handler that radcli_ctx_dispatch() itself invoked is undefined. Just don't. 😭

🎀 PARAMETERS 🎀

  • ctx — a context that was previously reported ready by radcli_ctx_get_poll(). That's the one. 🫶

⭐ RETURN VALUE ⭐

  • 0 — success, and yes that includes the "nothing was ready" case, it's giving chill 💜
  • -1 — failure (e.g. ctx is NULL, or you called it reentrantly 🙃)

🌈 SEE ALSO 🌈


and that's the page, bestie 🎀 go read all sixteen of those SEE ALSOs, iykyk. this whole thing is brought to you by radcli, version-dated 2026-10-10, living its best life as radcli_ctx_dispatch(3) — mwah 💋✨

📦 where this page comes from