Defining a server message callback

A server message callback is defined as follows:

CS_RETCODE CS_PUBLIC 
 servermsg_cb(context, connection, message)
 
 CS_CONTEXT           *context;
 CS_CONNECTION    *connection;
 CS_SERVERMSG      *message;

where:

Table 2-6: Routines that a server message callback can call

Callable routines

Permitted use

ct_config

To retrieve information only.

ct_con_props

To retrieve information or to set the CS_USERDATA property only.

ct_cmd_props

To retrieve information only. The CS_USERDATA property can be set on command structures allocated with ct_cmd_alloc.

The CS_USERDATA property cannot be set on the command structure obtained by the callback’s ct_con_props(CS_EED_CMD) call.

ct_cancel (CS_CANCEL_ATTN)

Any circumstances.

ct_bind, ct_describe, ct_fetch, ct_get_data, ct_res_info

The routines must be called with the command structure returned by the callback’s ct_con_props(CS_EED_CMD) call.

A server message callback calls these routines only while extended error data is available; that is, until ct_fetch returns CS_END_DATA.

See “Extended error data”.

WARNING! Do not call ct_poll from within any Client-Library callback function or from within any other function that can execute at the system-interrupt level.

Calling ct_poll at the system-interrupt level can corrupt Open Client/Server internal resources and cause recursion in the application.