Two methods for handling messages

An application can handle Client-Library and server messages using one of two methods:

Callbacks have these advantages:

Inline error handling, on the other hand, has the advantage of operating under an application’s direct control, which allows an application to check for messages at particular times. For example, an application might call ct_con_props a dozen times to customize a connection but check for errors only after the last call.

Most applications use callbacks to handle messages, but an application that is running on a platform-and-language combination that does not support callbacks must use the inline method.

An application indicates which method it will use by calling ct_callback to install message callbacks or by calling ct_diag to initialize inline message handling.