Macros | Functions
Vortex Connection: Related function to create and manage Vortex Connections.

Macros

#define CONN_CTX(c)   vortex_connection_get_ctx(c)
 Allows to get the context associated to the provided connection, logging a more verbose message if the context is null or the connection provided is null. More...
 
#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. More...
 

Functions

axl_bool vortex_connection_add_channel (VortexConnection *connection, VortexChannel *channel)
 Adds a VortexChannel into an existing VortexConnection. More...
 
axl_bool vortex_connection_add_channel_common (VortexConnection *connection, VortexChannel *channel, axl_bool do_notify)
 Adds a VortexChannel into an existing VortexConnection, allowing to configure notification. More...
 
void vortex_connection_block (VortexConnection *conn, axl_bool enable)
 Enable/disable connection blocking on the provided reference. More...
 
axl_bool vortex_connection_channel_exists (VortexConnection *connection, int channel_num)
 Check if a channel is already created on the given connection. More...
 
int vortex_connection_channels_count (VortexConnection *connection)
 Allows to get the number of channels installed on the provided connection. More...
 
axl_bool vortex_connection_close (VortexConnection *connection)
 Tries to close properly a connection and all channels inside it. More...
 
void vortex_connection_connect_timeout (VortexCtx *ctx, long microseconds_to_wait)
 Allows to configure vortex connect timeout. More...
 
void vortex_connection_delete_key_data (VortexConnection *connection, const char *key)
 Allows to remove a key/value pair installed by vortex_connection_set_data and vortex_connection_set_data_full without calling destroy functions associated. More...
 
axl_bool vortex_connection_do_greetings_exchange (VortexCtx *ctx, VortexConnection *connection, VortexConnectionOpts *options, int timeout)
 Do greetings exchange (BEEP session initialization) on the provided connection. More...
 
int vortex_connection_foreach_channel (VortexConnection *connection, axlHashForeachFunc func, axlPointer user_data)
 Allows to perform an iterator over all channels created inside the given connection. More...
 
void vortex_connection_free (VortexConnection *connection)
 Frees vortex connection resources. More...
 
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). More...
 
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. More...
 
VortexChannelvortex_connection_get_channel_by_uri (VortexConnection *connection, const char *profile)
 Allows to get the first channel ocurrence running the profile provided. More...
 
int vortex_connection_get_channel_count (VortexConnection *connection, const char *profile)
 Allows to get the number of channels running the profile provided. More...
 
VortexChannelPoolvortex_connection_get_channel_pool (VortexConnection *connection, int pool_id)
 Returns the channel pool identified by pool_id. More...
 
long vortex_connection_get_connect_timeout (VortexCtx *ctx)
 Allows to get current timeout set for VortexConnection connect operation. More...
 
VortexCtxvortex_connection_get_ctx (VortexConnection *connection)
 Allows to get the context under which the connection was created. More...
 
axlPointer vortex_connection_get_data (VortexConnection *connection, const char *key)
 Gets stored value indexed by the given key inside the given connection. More...
 
VortexHashvortex_connection_get_data_hash (VortexConnection *connection)
 Allows to get current data hash object used by the provided connection. More...
 
const char * vortex_connection_get_features (VortexConnection *connection)
 Returns current features requested by the remote peer this connection is linked to. More...
 
axlPointer vortex_connection_get_hook (VortexConnection *connection)
 Allows to get the user land pointer configured by vortex_connection_set_hook. More...
 
const char * vortex_connection_get_host (VortexConnection *connection)
 Returns the actual host this connection is connected to. More...
 
const char * vortex_connection_get_host_ip (VortexConnection *connection)
 Allows to get the actual host ip this connection is connected to. More...
 
int vortex_connection_get_id (VortexConnection *connection)
 Returns the connection unique identifier. More...
 
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). More...
 
const char * vortex_connection_get_local_addr (VortexConnection *connection)
 Allows to get local address used by the connection. More...
 
const char * vortex_connection_get_local_port (VortexConnection *connection)
 Allows to get the local port used by the connection. More...
 
const char * vortex_connection_get_localize (VortexConnection *connection)
 Returns current localize requested by the remote peer this connection is linked to. More...
 
const char * vortex_connection_get_message (VortexConnection *connection)
 Returns actual message status for the given connection. More...
 
int vortex_connection_get_mss (VortexConnection *connection)
 Allows to get maximum segment size negociated. More...
 
int vortex_connection_get_next_channel (VortexConnection *connection)
 Returns the next channel number free to be used over this session. More...
 
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. More...
 
int vortex_connection_get_opened_channels (VortexConnection *connection)
 Allows to get current opened channels for the provided connection. More...
 
int vortex_connection_get_pending_msgs (VortexConnection *connection)
 Allows to get current frames waiting to be sent on the given connection. More...
 
const char * vortex_connection_get_port (VortexConnection *connection)
 Returns the actual port this connection is connected to. More...
 
axlList * vortex_connection_get_remote_profiles (VortexConnection *connection)
 Returns the remote peer supported profiles. More...
 
VortexPeerRole vortex_connection_get_role (VortexConnection *connection)
 Allows to get current connection role. More...
 
const char * vortex_connection_get_server_name (VortexConnection *connection)
 Allows to get the serverName under which the remote BEEP peer is working. More...
 
VORTEX_SOCKET vortex_connection_get_socket (VortexConnection *connection)
 Returns the socket used by this VortexConnection object. More...
 
VortexStatus vortex_connection_get_status (VortexConnection *connection)
 Returns the current status for the provided connection. More...
 
long vortex_connection_get_timeout (VortexCtx *ctx)
 Allows to get current timeout set for VortexConnection synchronous operations. More...
 
axl_bool vortex_connection_half_opened (VortexConnection *conn)
 Allows to check if the provided connection is still in transit of being accepted. More...
 
void vortex_connection_invoke_preread_handler (VortexConnection *connection)
 Invokes the prer-read handler defined on the given connection. More...
 
axl_bool vortex_connection_is_blocked (VortexConnection *conn)
 Allows to check if the connection provided is blocked. More...
 
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. More...
 
axl_bool vortex_connection_is_ok (VortexConnection *connection, axl_bool free_on_fail)
 Allows to get current connection status. More...
 
axl_bool vortex_connection_is_profile_filtered (VortexConnection *connection, int channel_num, const char *uri, const char *profile_content, VortexEncoding encoding, const char *serverName, VortexFrame *frame, char **error_msg)
 Checks if a profile could be used, according to the current masks installed on the connection. More...
 
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. More...
 
axl_bool vortex_connection_is_tlsficated (VortexConnection *connection)
 Allows to get current status for TLS activation on the given connection. More...
 
VortexConnectionvortex_connection_new (VortexCtx *ctx, 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 using TCP/IPv4 resolution and transport. More...
 
VortexConnectionvortex_connection_new6 (VortexCtx *ctx, 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 using TCP/IPv6 resolution and transport. More...
 
VortexConnectionvortex_connection_new_empty (VortexCtx *ctx, VORTEX_SOCKET socket, VortexPeerRole role)
 Allows to create a new VortexConnection from a socket that is already connected. More...
 
VortexConnectionvortex_connection_new_full (VortexCtx *ctx, const char *host, const char *port, VortexConnectionOpts *options, VortexConnectionNew on_connected, axlPointer user_data)
 Allows to create a new BEEP session (connection) to the given host:port using provided options. More...
 
VortexConnectionvortex_connection_new_full6 (VortexCtx *ctx, const char *host, const char *port, VortexConnectionOpts *options, VortexConnectionNew on_connected, axlPointer user_data)
 Allows to create a new BEEP session (connection) to the given host:port using provided options and using TCP/IPv6. More...
 
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. More...
 
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. More...
 
axl_bool vortex_connection_reconnect (VortexConnection *connection, VortexConnectionNew on_connected, axlPointer user_data)
 Allows to reconnect the given connection, using actual connection settings. More...
 
axl_bool vortex_connection_ref (VortexConnection *connection, const char *who)
 Increase internal vortex connection reference counting. More...
 
int vortex_connection_ref_count (VortexConnection *connection)
 Allows to get current reference count for the provided connection. More...
 
axl_bool vortex_connection_ref_internal (VortexConnection *connection, const char *who, axl_bool check_ref)
 private API More...
 
void vortex_connection_remove_channel (VortexConnection *connection, VortexChannel *channel)
 Removes the given channel from this connection. More...
 
void vortex_connection_remove_channel_common (VortexConnection *connection, VortexChannel *channel, axl_bool do_notify)
 Removes the given channel from this connection. More...
 
void vortex_connection_remove_handler (VortexConnection *connection, VortexConnectionHandler handler_type, axlPointer handler_id)
 Allows to remove a particular handler (handler_type) with the provided handler id. More...
 
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. More...
 
void vortex_connection_sanity_socket_check (VortexCtx *ctx, axl_bool enable)
 Allows to disable sanity socket check, by default enabled. More...
 
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). More...
 
axl_bool vortex_connection_seq_frame_updates_status (VortexConnection *connection)
 Allows to get current configuration for SEQ frame generation. More...
 
axl_bool vortex_connection_set_blocking_socket (VortexConnection *connection)
 Allows to change connection semantic to blocking. More...
 
axlPointer 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. More...
 
axlPointer 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. More...
 
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. More...
 
void vortex_connection_set_connection_actions (VortexCtx *ctx, VortexConnectionStage stage, VortexConnectionAction action_handler, axlPointer handler_data)
 Allows to define custom actions to be implemented (by calling the function provided) at the connection creation. More...
 
void vortex_connection_set_data (VortexConnection *connection, const char *key, axlPointer value)
 Sets user defined data associated with the given connection. More...
 
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. More...
 
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. More...
 
VortexChannelFrameSize vortex_connection_set_default_next_frame_size_handler (VortexCtx *ctx, 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. More...
 
void vortex_connection_set_hook (VortexConnection *connection, axlPointer ptr)
 Allows to set a commonly used user land pointer associated to the provided connection. More...
 
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). More...
 
axl_bool vortex_connection_set_nonblocking_socket (VortexConnection *connection)
 Allows to change connection semantic to nonblocking. More...
 
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. More...
 
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. More...
 
void vortex_connection_set_on_close_full2 (VortexConnection *connection, VortexConnectionOnCloseFull on_close_handler, axl_bool insert_last, axlPointer data)
 Extended version for vortex_connection_set_on_close handler which also support receiving a user data pointer. More...
 
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. More...
 
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. More...
 
VortexReceiveHandler vortex_connection_set_receive_handler (VortexConnection *connection, VortexReceiveHandler receive_handler)
 Allows to configure receive handler use to actually receive data from remote peer. More...
 
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. More...
 
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. More...
 
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). More...
 
axl_bool vortex_connection_set_socket (VortexConnection *conn, VORTEX_SOCKET _socket, const char *real_host, const char *real_port)
 Allows to configure the socket to be used by the provided connection. More...
 
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). More...
 
void vortex_connection_shutdown_socket (VortexConnection *connection)
 Function used to just shutdown socket associated to the connection. More...
 
VORTEX_SOCKET vortex_connection_sock_connect (VortexCtx *ctx, const char *host, const char *port, int *timeout, axlError **error)
 Allows to create a plain socket connection against the host and port provided. More...
 
VORTEX_SOCKET vortex_connection_sock_connect_common (VortexCtx *ctx, const char *host, const char *port, int *timeout, VortexNetTransport transport, axlError **error)
 Allows to create a plain socket connection against the host and port provided allowing to configure the transport. More...
 
void vortex_connection_timeout (VortexCtx *ctx, long microseconds_to_wait)
 Allows to configure vortex internal timeouts for synchrnous operations. More...
 
axl_bool vortex_connection_uncheck_ref (VortexConnection *connection)
 Allows to perform a ref count operation on the connection provided without checking if the connection is working (no call to vortex_connection_is_ok). More...
 
void vortex_connection_unref (VortexConnection *connection, char const *who)
 Decrease vortex connection reference counting. More...
 

Detailed Description