radcli_request_perform3
Send a request, optionally waiting for the reply.
Usage
#include <radcli/>
int radcli_request_perform(
radcli_request *r,
unsigned flags
);
Overview
By default (flags == RADCLI_REQUEST_NONE), sends r and waits for the reply. With RADCLI_REQUEST_SENDONLY, transmits r a single time and returns once the packet is handed to the network, without blocking for a reply either as a pure fire-and-forget notification whose outcome the caller does not act on (call radcli_request_free() without ever calling radcli_ctx_dispatch(); radcli.h's rc_acct_async() is the equivalent call in the legacy API), or to read the reply later via radcli_request_done(), driven by the caller's own radcli_ctx_get_poll()/radcli_ctx_dispatch() loop (lib/dae.c).
May be called only once per request; construct a new radcli_request for a retransmission with different content.
Parameters
|
a request from radcli_request_new(). |
|---|---|
|
a bitwise OR of radcli_request_flags. |
Return value
with RADCLI_REQUEST_NONE: RADCLI_OK if a validated reply was received (see radcli_request_code() for which one), RADCLI_TIMEOUT if none of the server's addresses replied, or RADCLI_ERROR on failure. With RADCLI_REQUEST_SENDONLY: RADCLI_OK once the packet is handed to the network, RADCLI_ERROR on failure (e.g. name resolution or encoding failed); never RADCLI_TIMEOUT.