A server-message callback is a C function that is defined as follows:
CS_RETCODE servermsg_cb(context, connection, message)
CS_CONTEXT *context;
CS_CONNECTION *connection;
CS_SERVERMSG *message;
where:
context is a pointer to the CS_CONTEXT structure for which the message occurred.
connection is a pointer to the CS_CONNECTION structure for which the message occurred. connection can be NULL.
message is a pointer to a CS_SERVERMSG structure containing server message information. See the “CS_SERVERMSG Structure” topics page in the Open Client Client-Library/C Reference Manual for CS_SERVERMSG field descriptions.
message can have a new value each time the server-message callback is called.
Like other callbacks, a server-message callback is limited as to which Client-Library routines it can call. A server-message callback can call only the following routines:
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 or to set the CS_USERDATA property only
ct_cancel(CS_CANCEL_ATTN)
ct_res_info, ct_bind, ct_describe, ct_fetch, and ct_get_data, to process extended error data only
A server-message callback must return CS_SUCCEED.