CA_Set_Options()

Purpose

Provides the capability to set custom server runtime options.

Libraries

Blueworx Voice Response library (libvae.a)

Custom Server library (libca.a)

Syntax

#include "CA_header.h"
int CA_Set_Options (
 int   flags,
 CA_OPTIONS_ST * ca_options_sp
);

Description

This subroutine provides the capability to enable or disable custom server runtime options prior to initializing the custom server. It must be called prior to calling the CA_Init() subroutine.

The default value is SINGLE_PROCESS_CA, which specifies that the custom server will be executing as a single process. It is not necessary to call CA_Set_Options() to specify this option.

If you specify the value as MULTI_PROCESS_CA, the initialization subroutine will use shared memory instead of allocating local memory to store control information for the custom server. Then, after a custom server process has initialized, multiple processes can be started from the original process using the AIX fork subroutine. This gives you greater flexibility in creating applications that require handling requests asynchronously. Refer to the AIX documentation for an explanation of the fork subroutine.

To set the multiple process flag when the custom server type is System Generated main(), add a C Flag called -DMULTI to the existing set of compile-time flags.

SET_MAX_POOL_BUFFERS allows you to specify the maximum number of pool buffers to be held by a custom server. This number is checked every time a message is sent to a custom server by a corresponding state table action or CA_Send_CA_Msg() subroutine call. An environment variable, CA_THRESHOLD_PERCENTAGE can also be set (see What does pool buffer threshold reached mean?) to limit the total number of pool buffers used by the custom server subsystem, that is all custom servers combined. If one of the thresholds has been reached, any new message will be discarded and an error will be logged. Once the custom server pool buffer count is below the threshold, normal processing will continue.

The default value for CA_THRESHOLD_PERCENTAGE is 75. You can set it to values between 20 and 95. The default value for max_pool_buffers is the total number of system buffers. You can set it to values from MIN_CA_POOL_BUFFERS to TOTAL_POOL_BUFFERS.

Note: If the CA_THRESHOLD_PERCENTAGE value specified is not within the valid range, the default value is used. If the max_pool_buffers value specified is not within the valid range, the request fails.

Parameters

flags
Specifies the options to be set. Possible values are SINGLE_PROCESS_CA, MULTI_PROCESS_CA, and SET_MAX_POOL_BUFFERS. You can select more than one of these options by ORing the flags together.
ca_options_sp
A pointer to a CA_OPTIONS_ST input structure, filled in as described in CA_OPTIONS_ST.

Return codes

0
Successful
-1
Unsuccessful (global error number CA_errno is set to indicate the error)

Error names

CA_ALREADY_STARTED
CA_INV_ADDR
CA_INV_MAX_BUFFERS

Related information

CA_Init().