Vortex Connection: Related function to create and manage Vortex Connections.


Defines

#define SERVER_NAME_FROM_CHANNEL(channel)   (vortex_connection_get_server_name (vortex_channel_get_connection (channel)))
 Allows to get the associated serverName value under which the connection is working.

Functions

void vortex_connection_add_channel (VortexConnection *connection, VortexChannel *channel)
 Adds a VortexChannel into an existing VortexConnection.
void vortex_connection_block (VortexConnection *conn, axl_bool enable)
 Enable/disable connection blocking on the provided reference.
axl_bool vortex_connection_channel_exists (VortexConnection *connection, int channel_num)
 Check if a channel is already created on the given connection.
int vortex_connection_channels_count (VortexConnection *connection)
 Allows to get the number of channels installed on the provided connection.
axl_bool vortex_connection_close (VortexConnection *connection)
 Tries to close properly a connection and all channels inside it.
void vortex_connection_connect_timeout (long int microseconds_to_wait)
 Allows to configure vortex connect timeout.
void vortex_connection_foreach_channel (VortexConnection *connection, axlHashForeachFunc func, axlPointer user_data)
 Allows to perform an iterator over all channels created inside the given connection.
void vortex_connection_free (VortexConnection *connection)
 Frees vortex connection resources.
VortexChannelvortex_connection_get_channel (VortexConnection *connection, int channel_num)
 Returns a reference to the channel identified by channel_num on this connection (or vortex session).
VortexChannelvortex_connection_get_channel_by_func (VortexConnection *connection, VortexChannelSelector selector, axlPointer user_data)
 Allows to select a channel from the set of channels created on the provided connection, using a function that acts as a selector.
VortexChannelvortex_connection_get_channel_by_uri (VortexConnection *connection, const char *profile)
 Allows to get the first channel ocurrence running the profile provided.
int vortex_connection_get_channel_count (VortexConnection *connection, const char *profile)
 Allows to get the number of channels running the profile provided.
VortexChannelPoolvortex_connection_get_channel_pool (VortexConnection *connection, int pool_id)
 Returns the channel pool identified by pool_id.
long int vortex_connection_get_connect_timeout (void)
 Allows to get current timeout set for VortexConnection connect operation.
axlPointer vortex_connection_get_data (VortexConnection *connection, const char *key)
 Gets stored value indexed by the given key inside the given connection.
const char * vortex_connection_get_features (VortexConnection *connection)
 Returns current features requested by the remote peer this connection is linked to.
const char * vortex_connection_get_host (VortexConnection *connection)
 Returns the actual host this connection is connected to.
int vortex_connection_get_id (VortexConnection *connection)
 Returns the connection unique identifier.
VortexConnectionvortex_connection_get_listener (VortexConnection *connection)
 In the case the connection was automatically created at the listener BEEP side, the connection was accepted under an especific listener started with vortex_listener_new (and its associated functions).
const char * vortex_connection_get_localize (VortexConnection *connection)
 Returns current localize requested by the remote peer this connection is linked to.
char * vortex_connection_get_message (VortexConnection *connection)
 Returns actual message status for the given connection.
int vortex_connection_get_mss (VortexConnection *connection)
 Allows to get maximum segment size negociated.
int vortex_connection_get_next_channel (VortexConnection *connection)
 Returns the next channel number free to be used over this session.
int vortex_connection_get_next_frame_size (VortexConnection *connection, VortexChannel *channel, int next_seq_no, int message_size, int max_seq_no)
 Allows to get the amount of data to be used to build the next frame.
int vortex_connection_get_opened_channels (VortexConnection *connection)
 Allows to get current opened channels for the provided connection.
int vortex_connection_get_pending_msgs (VortexConnection *connection)
 Allows to get current frames waiting to be sent on the given connection.
const char * vortex_connection_get_port (VortexConnection *connection)
 Returns the actual port this connection is connected to.
axlList * vortex_connection_get_remote_profiles (VortexConnection *connection)
 Returns the remote peer supported profiles.
VortexPeerRole vortex_connection_get_role (VortexConnection *connection)
 Allows to get current connection role.
const char * vortex_connection_get_server_name (VortexConnection *connection)
 Allows to get the serverName under which the connection is acting.
VORTEX_SOCKET vortex_connection_get_socket (VortexConnection *connection)
 Returns the socket used by this VortexConnection object.
long int vortex_connection_get_timeout (void)
 Allows to get current timeout set for VortexConnection synchronous operations.
void vortex_connection_invoke_preread_handler (VortexConnection *connection)
 Invokes the prer-read handler defined on the given connection.
axl_bool vortex_connection_is_blocked (VortexConnection *conn)
 Allows to check if the connection provided is blocked.
axl_bool vortex_connection_is_defined_preread_handler (VortexConnection *connection)
 Allows to check if there are an pre read handler defined on the given connection.
axl_bool vortex_connection_is_ok (VortexConnection *connection, axl_bool free_on_fail)
 Allows to get current connection status.
axl_bool vortex_connection_is_profile_filtered (VortexConnection *connection, int channel_num, const char *uri, const char *profile_content, const char *serverName)
 Checks if a profile could be used, according to the current masks installed on the connection.
axl_bool vortex_connection_is_profile_supported (VortexConnection *connection, const char *uri)
 Allows to check if the given profile is supported by the remote peer.
axl_bool vortex_connection_is_tlsficated (VortexConnection *connection)
 Allows to get current status for TLS activation on the given connection.
VortexConnectionvortex_connection_new (const char *host, const char *port, VortexConnectionNew on_connected, axlPointer user_data)
 Allows to create a new BEEP session (connection) to the given host:port.
VortexConnectionvortex_connection_new_empty (int session, VortexPeerRole role)
 Allows to create a new VortexConnection from a socket that is already connected.
void vortex_connection_notify_new_connections (VortexConnectionNotifyNew notify_new, axlPointer user_data)
 Allows to configure a handler which is called for each connection created.
axl_bool vortex_connection_parse_greetings_and_enable (VortexConnection *connection, VortexFrame *frame)
 Allows to parse greetings reply received and prepare the connection to be become usable.
axl_bool vortex_connection_pop_channel_error (VortexConnection *connection, int *code, char **msg)
 Allows to get the next channel error message stored in the provided connection.
axl_bool vortex_connection_reconnect (VortexConnection *connection, VortexConnectionNew on_connected, axlPointer user_data)
 Allows to reconnect the given connection, using actual connection settings.
axl_bool vortex_connection_ref (VortexConnection *connection, const char *who)
 Increase internal vortex connection reference counting.
int vortex_connection_ref_count (VortexConnection *connection)
 Allows to get current reference count for the provided connection.
void vortex_connection_remove_channel (VortexConnection *connection, VortexChannel *channel)
 Removes the given channel from this connection.
axl_bool vortex_connection_remove_on_close_full (VortexConnection *connection, VortexConnectionOnCloseFull on_close_handler, axlPointer data)
 Allows to uninstall a particular handler installed to get notifications about the connection close.
void vortex_connection_sanity_socket_check (axl_bool enable)
 Allows to disable sanity socket check, by default enabled.
void vortex_connection_seq_frame_updates (VortexConnection *connection, axl_bool is_disabled)
 Allows to control if the provided connection will produce SEQ frame updates (send to the remote peer SEQ frames).
axl_bool vortex_connection_seq_frame_updates_status (VortexConnection *connection)
 Allows to get current configuration for SEQ frame generation.
void vortex_connection_set_auto_tls (axl_bool enabled, axl_bool allow_tls_failures, const char *serverName)
 Allows to activate TLS profile automatic negotiation for every connection created.
axl_bool vortex_connection_set_blocking_socket (VortexConnection *connection)
 Allows to change connection semantic to blocking.
void vortex_connection_set_channel_added_handler (VortexConnection *connection, VortexConnectionOnChannelUpdate added_handler, axlPointer user_data)
 Allows to configure a handler which is executed once a channel is added to the provided connection.
void vortex_connection_set_channel_removed_handler (VortexConnection *connection, VortexConnectionOnChannelUpdate removed_handler, axlPointer user_data)
 Allows to configure a handler which is executed once a channel is removed from the provided connection.
void vortex_connection_set_close_socket (VortexConnection *connection, axl_bool action)
 Allows to configure what to do with the underlying socket connection when the VortexConnection is closed.
void vortex_connection_set_data (VortexConnection *connection, const char *key, axlPointer value)
 Sets user defined data associated with the given connection.
void vortex_connection_set_data_full (VortexConnection *connection, char *key, axlPointer value, axlDestroyFunc key_destroy, axlDestroyFunc value_destroy)
 Allows to store user space data into the connection like vortex_connection_set_data does but configuring functions to be called once required to deallocate data stored.
void vortex_connection_set_default_io_handler (VortexConnection *connection)
 Set default IO handlers to be used while sending and receiving data for the given connection.
VortexChannelFrameSize vortex_connection_set_default_next_frame_size_handler (VortexChannelFrameSize next_frame_size, axlPointer user_data)
 Configures default frame segmentation function (VortexChannelFrameSize) used for all connections and all channels that do not have a segmentator defined.
VortexChannelFrameSize vortex_connection_set_next_frame_size_handler (VortexConnection *connection, VortexChannelFrameSize next_frame_size, axlPointer user_data)
 Allows to configure the VortexChannelFrameSize handler to be used by the sequencer to decide how many data is used into each frame produced (outstanding frames).
axl_bool vortex_connection_set_nonblocking_socket (VortexConnection *connection)
 Allows to change connection semantic to nonblocking.
void vortex_connection_set_on_close (VortexConnection *connection, VortexConnectionOnClose on_close_handler)
 Allows to set a new on close handler to be executed only once the connection is being closed.
void vortex_connection_set_on_close_full (VortexConnection *connection, VortexConnectionOnCloseFull on_close_handler, axlPointer data)
 Extended version for vortex_connection_set_on_close handler which also support receiving a user data pointer.
void vortex_connection_set_preread_handler (VortexConnection *connection, VortexConnectionOnPreRead pre_accept_handler)
 Allows to configure a handler to be executed before any operations is applied inside the Vortex Reader process.
int vortex_connection_set_profile_mask (VortexConnection *connection, VortexProfileMaskFunc mask, axlPointer user_data)
 Allows to configure a profile mask, an external handler which is executed to check if a profile must be showed in the greetings process.
VortexReceiveHandler vortex_connection_set_receive_handler (VortexConnection *connection, VortexReceiveHandler receive_handler)
 Allows to configure receive handler use to actually receive data from remote peer.
VortexSendHandler vortex_connection_set_send_handler (VortexConnection *connection, VortexSendHandler send_handler)
 Allows to configure the send handler used to actually perform sending operations over the underlying connection.
axl_bool vortex_connection_set_sock_block (VORTEX_SOCKET socket, axl_bool enable)
 Allows to enable/disable non-blocking/blocking behavior on the provided socket.
axl_bool vortex_connection_set_sock_tcp_nodelay (VORTEX_SOCKET socket, axl_bool enable)
 Allows to configure tcp no delay flag (enable/disable Nagle algorithm).
void vortex_connection_shutdown (VortexConnection *connection)
 Shutdown the connection provided immediately without doing BEEP session close, flagging the connection as non connected (without deallocating resources associated to the connection).
void vortex_connection_timeout (long int microseconds_to_wait)
 Allows to configure vortex internal timeouts for synchrnous operations.
void vortex_connection_unref (VortexConnection *connection, const char *who)
 Decrease vortex connection reference counting.