.\" File automatically generated by doxy2man0.3 .\" Generation date: Thu Sep 3 2026 .TH radcli_ctx_dispatch 3 2026-09-03 "radcli" "Radius client library" .SH "NAME" radcli_ctx_dispatch \- 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. .SH SYNOPSIS .nf .B #include .sp \fBint radcli_ctx_dispatch\fP( \fBradcli_ctx *\fP\fIctx\fP ); .fi .SH DESCRIPTION .PP 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). .PP Not reentrant: calling this, radcli_dae_start(), or radcli_dae_free() from within a handler radcli_ctx_dispatch() itself invoked is undefined. .SH PARAMETERS .TP .B ctx a context previously reported ready by radcli_ctx_get_poll(). .SH RETURN VALUE .PP 0 on success (including "nothing was ready"), -1 on failure (e.g. ctx is NULL, or called reentrantly). .SH SEE ALSO .PP .nh .ad l \fIradcli_ctx_get_poll\fP(3), \fIradcli_dae_free\fP(3), \fIradcli_dae_new\fP(3), \fIradcli_dae_process\fP(3), \fIradcli_dae_reply\fP(3), \fIradcli_dae_reply_error\fP(3), \fIradcli_dae_reply_to_buffer\fP(3), \fIradcli_dae_req_attrs\fP(3), \fIradcli_dae_req_code\fP(3), \fIradcli_dae_req_framed_ip\fP(3), \fIradcli_dae_req_nas_port\fP(3), \fIradcli_dae_req_session_id\fP(3), \fIradcli_dae_req_user_name\fP(3), \fIradcli_dae_request_free\fP(3), \fIradcli_dae_set_handler\fP(3), \fIradcli_dae_start\fP(3) .ad .hy