typedef int(* VortexConnectionAction)(VortexCtx *ctx, VortexConnection *conn, VortexConnection **new_conn, VortexConnectionStage stage, axlPointer user_data)

Handler definition for the set of functions that are called during the connection creation and configured by vortex_connection_set_connection_actions.

See VortexConnectionStage definition for available events.

ctxThe context where the operation is taking place.
connThe connection that is notified.
new_connIn the case the action creates a new connection that must replace the connection received, this variable is used to notify the new reference.
stageThe stage during the notification is taking place.
user_dataUser defined data associated to the action. This was configured at vortex_connection_set_connection_actions.
The function must return a set of codes that are used by the library to handle errors. The action must return:
  • (-1) in the case an error is found during the action processing. In this case, the connection is shutted down and a non connected reference is returned to the caller.
  • (0) in the case no error was found and the function wants to stop action processing. This is useful to block other actions.
  • (1) in the case no error was found and the function don't care about other actions being executed. the function executed the action without errors.
  • (2) in the case the function creates a new connection and updates references (using new_conn). In this case, the action handler is responsible of the connection received and its deallocation.