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:
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.
message is a pointer to a CS_SERVERMSG structure containing server message information. For information on this structure, see the “CS_SERVERMSG structure”.
Note that message can have a new value each time the server message callback is called.
A server message callback must return CS_SUCCEED.
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. |
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.