Handling messages with callback routines

Most applications use callbacks to handle Client-Library and server messages. The application defines and installs callback routines to handle Client-Library and server messages. When a message is generated, Client-Library calls the appropriate callback and passes details about the message using the callback’s input parameters.

To use the callback method, an application must define and install:

An application calls ct_callback to install a message callback. Once installed, the callbacks are automatically triggered when a Client-Library or server message occurs.

Client-Library stores callback locations in the CS_CONNECTION and CS_CONTEXT structures. Because of this, when a Client-Library error occurs that makes a CS_CONNECTION or CS_CONTEXT structure unusable, Client-Library cannot call the client-message callback. Instead, the routine that caused the error returns CS_FAIL.