libamxo  4.3.4
Object Definition Language (ODL) parsing
Connection management
Collaboration diagram for Connection management:

Functions

int amxo_connection_add (amxo_parser_t *parser, int fd, amxo_fd_cb_t reader, const char *uri, amxo_con_type_t type, void *priv)
 Adds a file descriptor (fd) to the list of fds that must be watched. More...
 
int amxo_connection_wait_write (amxo_parser_t *parser, int fd, amxo_fd_cb_t writer)
 Adds a watcher to check if a fd is ready for write. More...
 
int amxo_connection_remove (amxo_parser_t *parser, int fd)
 Removes the fd from the connection list. More...
 
amxo_connection_tamxo_connection_get (amxo_parser_t *parser, int fd)
 Gets the connection data for a file descriptor. More...
 
int amxo_connection_set_el_data (amxo_parser_t *parser, int fd, void *el_data)
 Sets event-loop data. More...
 
amxo_connection_tamxo_connection_get_first (amxo_parser_t *parser, amxo_con_type_t type)
 Gets the first connection of the given type. More...
 
amxo_connection_tamxo_connection_get_next (amxo_parser_t *parser, amxo_connection_t *con, amxo_con_type_t type)
 Gets the next connection data for a file descriptor. More...
 

Detailed Description

Function Documentation

◆ amxo_connection_add()

int amxo_connection_add ( amxo_parser_t parser,
int  fd,
amxo_fd_cb_t  reader,
const char *  uri,
amxo_con_type_t  type,
void *  priv 
)

Adds a file descriptor (fd) to the list of fds that must be watched.

This function is deprecated use amxp_connection_add instead.

Parameters
parserthe odl parser instance
fdthe fd that must be watched
readerthe read callback function, is called when data is available for read
uri(option, can be NULL) a uri representing the fd
typeone of AMXO_BUS, AMXO_LISTEN, AMXO_CUSTOM
privprivate data, will be passed to the callback function
Returns
Returns 0 when success, any other value indicates failure.

◆ amxo_connection_get()

amxo_connection_t* amxo_connection_get ( amxo_parser_t parser,
int  fd 
)

Gets the connection data for a file descriptor.

This function is deprecated use amxp_connection_get instead.

Parameters
parserthe odl parser instance
fdthe fd that must be watched
Returns
returns pointer to the connection data or NULL if no data is found.

◆ amxo_connection_get_first()

amxo_connection_t* amxo_connection_get_first ( amxo_parser_t parser,
amxo_con_type_t  type 
)

Gets the first connection of the given type.

This function is deprecated use amxp_connection_get_first instead.

Parameters
parserthe odl parser instance
typeone of AMXO_BUS, AMXO_LISTEN, AMXO_CUSTOM
Returns
returns pointer to the connection data or NULL if no data is found.

◆ amxo_connection_get_next()

amxo_connection_t* amxo_connection_get_next ( amxo_parser_t parser,
amxo_connection_t con,
amxo_con_type_t  type 
)

Gets the next connection data for a file descriptor.

This function is deprecated use amxp_connection_get_next instead.

Parameters
parserthe odl parser instance
constarting point reference
typeone of AMXO_BUS, AMXO_LISTEN, AMXO_CUSTOM
Returns
returns pointer to the connection data or NULL if no data is found.

◆ amxo_connection_remove()

int amxo_connection_remove ( amxo_parser_t parser,
int  fd 
)

Removes the fd from the connection list.

This function is deprecated use amxp_connection_remove instead.

Parameters
parserthe odl parser instance
fdthe fd that must be watched
Returns
Returns 0 when success, any other value indicates failure.

◆ amxo_connection_set_el_data()

int amxo_connection_set_el_data ( amxo_parser_t parser,
int  fd,
void *  el_data 
)

Sets event-loop data.

This function is deprecated use amxp_connection_set_el_data instead.

Parameters
parserthe odl parser instance
fdthe fd that must be watched
el_datasome event loop data
Returns
Returns 0 when success, any other value indicates failure.

◆ amxo_connection_wait_write()

int amxo_connection_wait_write ( amxo_parser_t parser,
int  fd,
amxo_fd_cb_t  writer 
)

Adds a watcher to check if a fd is ready for write.

This function is deprecated use amxp_connection_wait_write instead.

Parameters
parserthe odl parser instance
fdthe fd that must be watched
writera callback function called when the socket is available for write
Returns
Returns 0 when success, any other value indicates failure.