VortexChannelPool * vortex_xml_rpc_create_channel_pool ( VortexConnection connection,
const char *  serverName,
const char *  resourceName,
VortexOnChannelPoolCreated  on_pool_created,
axlPointer  user_data 

Allows to create and attach a channel pool containing XML-RPC channels that are created using the provided serverName and resourceName value.

An efficient alternative to create a XML-RPC channel (vortex_xml_rpc_boot_channel), perform the invocation (vortex_xml_rpc_invoke), and then release the channel (automatically done by the invocation API) is to use a channel pool.

The channel pool maintains a set of channels available to be used, and them are reused across invocations. In the case more channels are required, the channel pool automatically negotiate them for you.

The idea is to create a channel pool (you can create several channel pools on the channel connection) using the function, making all channels inside the pool created to use the serverName and the resourceName value provided.

 void create_pool () {
   VortexChannelPool * pool;
   // create a pool that uses as resource "/API/v1.0"
   pool = vortex_xml_rpc_create_channel_pool (connection, 
                                              // no server name value 
                                              // resource value
                                              // no pool creation notify
                                              NULL, NULL);

Later in your code, if you require a XML-RPC channel to perform an invocation, you get it from the channel pool:

 void invoke (XmlRpcMethodCall * invocator) {
   VortexChannel        * channel;
   XmlRpcMethodResponse * response;

   // get a channel (creating it if not available, using default pool: 1)
   channel = vortex_xml_rpc_channel_pool_get_next (connection, axl_true, 1);
   // now perform the invocation
   response = vortex_xml_rpc_invoke_sync (channel, invocator);

   // some something with the reply

   // the channel is not required to be released by calling to
   // vortex_channel_pool_release_channel because it is already done
   // by the invocation API: vortex_xml_rpc_invoke (_sync)

connection The connection where the channel pool is created.
serverName The serverName value to be used while creating more channels in the pool.
resourceName The resource value to be used while creating more channel in the pool.
on_pool_created The channel pool created notification. See handler documentation. If the handler is provided, the function will return NULL and the channel pool reference created will be received at the handler notification.
user_data User defined data to be passed in to the on_pool_created handler.
A newly created VortexChannelPool or NULL if it fails or a channel pool created notification was received.