Broker 10.5 | webMethods Broker Documentation | webMethods Broker Client C API Programmer's Guide | API Reference | awRegister | awRegisterCallbackForSubId
 
awRegisterCallbackForSubId
BrokerError awRegisterCallbackForSubId(
BrokerClient client,
int sub_id,
BrokerCallback func,
void *client_data);
client
The Broker client for which the callback is being registered.
sub_id
The specific subscription ID of the events to be handled.
func
The callback function to be called to handle the event. See Defining a Callback Function.
client_data
A pointer to user-defined data that will be passed to the callback function when it is invoked.
Registers a specific callback func to process events with the specified sub_id that are received by client. When an event with the specified subscription ID is received for client, the callback function func will be invoked to process that event and will be passed client_data as a parameter. The content and use of client_data is determined by you the caller; it is not examined or used in any way by the Broker system.
Note:
You must register a general callback object, using the awRegisterCallback function, before calling this function.
If a callback function has already been registered for sub_id, the previous callback registration will be replaced with the new registration.
Note:
When using this function, make sure that each of the Broker client's event subscriptions uses a unique subscription ID if you want the events to be processed by different callback functions. Use non unique subscription IDs if you want multiple event types to be processed by the same callback function.
Possible BrokerError major codes
Meaning
AW_ERROR_BAD_STATE
No general callback has been registered.
AW_ERROR_INVALID_CLIENT
The client has been destroyed or disconnected.
AW_ERROR_NULL_PARAM
The func is NULL.
AW_ERROR_OUT_OF_RANGE
The sub_id parameter is less zero.
See also: