Callback functions for connection lifecycle events.
More...
#include <ctaps.h>
Callback functions for connection lifecycle events.
Set these callbacks via ct_preconnection_initiate() or ct_preconnection_listen(). All callbacks are invoked from the event loop thread.
Definition at line 1152 of file ctaps.h.
◆ closed
Called when connection is closed and can be safely freed.
Definition at line 1169 of file ctaps.h.
◆ connection_error
| void(* ct_connection_callbacks_t::connection_error) (ct_connection_t *connection) |
Called when a connection error occurs after establishment.
Definition at line 1154 of file ctaps.h.
◆ establishment_error
| void(* ct_connection_callbacks_t::establishment_error) (ct_connection_t *connection) |
Called when connection establishment fails.
Definition at line 1157 of file ctaps.h.
◆ expired
Called when a connection expires (e.g., timeout).
Definition at line 1160 of file ctaps.h.
◆ path_change
| void(* ct_connection_callbacks_t::path_change) (ct_connection_t *connection) |
Called when the connection's network path changes, local or remote.
Definition at line 1163 of file ctaps.h.
◆ per_connection_context
| void* ct_connection_callbacks_t::per_connection_context |
User-provided context for the connection lifetime.
Per connection context accessible whenever a given connection is passed to a callback.
Can be fetched with ct_connection_get_callback_context(connection)
recv_ctx->num_received_messages++;
}
void * ct_connection_get_callback_context(const ct_connection_t *connection)
Get the connection's callback context.
Opaque handle representing a connection.
Opaque handle representing message metadata to pass to sending protocol.
Opaque handle representing a single message to be sent or received.
Definition at line 1196 of file ctaps.h.
◆ ready
Called when connection is established and ready for data transfer.
Definition at line 1166 of file ctaps.h.
◆ send_error
Called when a message send operation fails.
Definition at line 1172 of file ctaps.h.
◆ sent
Called when a message is passed to the transport protocol.
Definition at line 1176 of file ctaps.h.
◆ soft_error
| void(* ct_connection_callbacks_t::soft_error) (ct_connection_t *connection) |
Called when a non-fatal error occurs (e.g., congestion).
Definition at line 1179 of file ctaps.h.
The documentation for this struct was generated from the following file:
- /home/runner/work/CTaps/CTaps/include/ctaps.h