radcli_ctx_dispatch3
Read what is ready on ctx's descriptor(s), validate it, and invoke the registered handler for anything that passes see radcli_dae_set_handler(). also: drains any in-flight radcli_request_sendonly exchange's reply and services its retransmit/ timeout deadline (net2.md's req-net2-send-013/016), and, once due, sends the rfc 5997 watchdog on an established radsec session (watchdog.md's req-watchdog-net-001) all unconditionally, every call, regardless of whether an active radcli_dae exists at all: this is now the single entry point radcli_ctx_get_poll() drives, for everything ctx owns, not a dae-only call.
Usage
#include <radcli/>
int radcli_ctx_dispatch(
radcli_ctx *ctx
);
Overview
On the DAE side specifically, reads exactly one datagram per call (non-blocking), so a burst of requests re-arms the caller's loop rather than starving it, and runs it through process_packet()'s validation pipeline before ever invoking the registered handler. Every rejection short of "authorized sender" is silent: no reply, no Error-Cause, no log of the secret or either authenticator (REQ-DAE-SEC-009).
Not reentrant: calling this, radcli_dae_start(), or radcli_dae_free() from within a handler radcli_ctx_dispatch() itself invoked is undefined.
Parameters
ctx-
a context previously reported ready by radcli_ctx_get_poll().
Return value
0 on success (including "nothing was ready"), -1 on failure (e.g. ctx is NULL, or called reentrantly).