VortexChannel * vortex_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.

This function allows to provide a finer control while selecting channels already created on a connection. Similiar to the function provided by vortex_connection_get_channel_by_uri, this function allows implement more elaborated selection patters, especiall if it is found the same profile running several times (for examcple, xml-rpc with different resources).

The idea behind this function is that you provide a function which is called for each channel found on the connection until that function returns axl_true. For example:

1 axl_bool select_channel (VortexChannel * channel, axlPointer user_data)
2 {
3  // implement here some selection pattern and return axl_true
4  // to select
5  return axl_true;
6 }
8 // call to search using the function
9 channel = vortex_connection_get_channel_by_func (connection,
10  select_channel,
11  NULL);
connectionThe connection where the selection will be performed.
selectorThe function to be called for each channel found on the connection.
user_dataA reference to user defined pointer to be passed to the function (func parameter).
A reference to the channel selected or NULL if it fails.

References vortex_hash_foreach3().