Register a callback that will be invoked when the active channel is being destroyed.
BPS_API int bps_register_channel_destroy_handler(void(*destroy_handler)(void *), void *data)
The callback that is invoked on channel destruction.
The user data that is passed to the destroy_handler.
Library:libbps (For the qcc command, use the -l bps option to link against this library)
The function is used for services that have channel specific resources allocated that require cleanup when the channel is destroyed. At a minimum, most services have at least one file descriptor that needs to be closed.
The destroy_handler is invoked when the channel is destroyed and the user data is passed into the function as the first argument. In the destroy_handler, do not call BPS library functions that use the channel that is being destroyed, with the exception of the bps_get_domain_data() function.
BPS_SUCCESS when the handler has successfully been registered along with the data, BPS_FAILURE with errno value set otherwise.
Last modified: 2014-09-30