VortexConnection * vortex_external_connection_new ( VortexCtx ctx,
VORTEX_SOCKET  _session,
VortexSendHandler  _send_handler,
VortexReceiveHandler  _received_handler,
VortexExternalSetup setup,
VortexConnectionNew  on_connected,
axlPointer  user_data 

Creates a new BEEP connection to a remote BEEP server using a session that is already created and a set of handlers to do the I/O.

ctxThe context where the operation will take place.
_sessionThe session to configure/wrap around Vortex/BEEP API. This session must be working and has to be created before calling to this function.
_send_handlerThe handler that will be used to do the write operation
_received_handlerThe handler that will be used to do read operation
setupA reference (optional) to the setup object (vortex_external_setup_new).
on_connectedOptional handler to process connection new status.
user_dataOptional handler to process connection new status
A newly created VortexConnection if called in a blocking manner, that is, without providing the on_connected handler. If you provide the on_connected handler, the function will return NULL, and the connection created will be notified on the handler on_connected. In both cases, you must use vortex_connection_is_ok to check if you are already connected.

NOTE: The VortexCtx object to be used on this function will be the one configured on setup parameter (reference provided at vortex_external_setup_new). This means you'll have to create different VortexExternalSetup instances for each context you have.

References vortex_connection_do_greetings_exchange(), vortex_connection_is_ok(), vortex_connection_set_data_full(), vortex_connection_set_receive_handler(), vortex_connection_set_send_handler(), vortex_mutex_create(), and VortexRoleInitiator.