Callback functions are user-defined functions that notify an application when an event has occurred. These functions are registered with Monitor Client Library API calls for:
Alarms
Error information
When either of the above events occur, a callback function is executed.
SMC_VOID CallbackFunction (SMC_CONNECT_ID clientId, SMC_COMMAND_ID commandId, SMC_VOIDP userDataHandle)
identifies the connection.
identifies the instance of a command.
user data pointer for a given connection. An application can set this pointer by using smc_connect_props.
When an event triggers a callback function, you can request information about the event. Data is accessed by calling smc_get_command_info from within the callback function. This function takes a connection ID, a command ID, and an enumerator constant that identifies which piece of data the user is interested in. The data available depends on the type of callback. Table 3-3 describes the data available for alarm callbacks. Table 3-4 describes the data available for error callbacks.
Information type |
Description |
---|---|
SMC_INFO_ERR_MAPSEVERITY |
Monitor Client Library severity level. |
SMC_INFO_ERR_MSG |
Text of the error message. (See Appendix D, “Troubleshooting Information and Error Messages”.) |
SMC_INFO_ERR_NUM |
Number of the error. |
SMC_INFO_ERR_SEVERITY |
Severity of the error message. |
SMC_INFO_ERR_SOURCE |
Source of the error message. One of the following:
|
SMC_INFO_ERR_STATE |
State of the error. Useful for technical support in diagnosing internal errors. |
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |