ASYNC_WAIT_CTX_set_callback

Register a callback notified when an engine completes an async operation.

Synopsis

Declared in <openssl/async.h>

int
ASYNC_WAIT_CTX_set_callback(
    ASYNC_WAIT_CTX* ctx,
    ASYNC_callback_fn callback,
    void* callback_arg);

Description

Prefer this when a wait file descriptor is too costly or unavailable. Pair with ASYNC_WAIT_CTX_set_status() so the engine can report ASYNC_STATUS_* progress.

Return Value

1 on success, or 0 on error.

Parameters

NameDescription
ctxWait context that stores the callback.
callbackFunction invoked from a poll or interrupt context; must be small and nonblocking.
callback_argUser argument passed to callback.