tibrvcmEventCallback

Function Type

Declaration

typedef void (*tibrvcmEventCallback) (
    tibrvcmEvent        cmListener,
    tibrvMsg            message,
    void*               closure);

Purpose

Programs define functions of this type to process inbound certified or labeled messages.

Remarks

This callback function must also be able to process uncertified and unlabeled messages.

Parameter

Description

cmListener

This parameter receives the listener object. This object is identical to the certified listener object that the program created to begin listening.

message

The callback receives the inbound message in this parameter. If the inbound message is empty, this parameter receives a message that has no fields.

closure

This parameter receives the closure data, which the program supplied in the call that created the event object.

CM Label Information

CM callback functions can use CM label information to discriminate these situations:

If tibrvMsg_GetCMSender() returns status code TIBRV_NOT_FOUND, then the message uses the reliable protocol (that is, it was sent from an ordinary transport).
If tibrvMsg_GetCMSender() returns TIBRV_OK, then the message uses the certified delivery protocol (that is, it is a labeled message, sent from a CM transport).

Once the CM callback function determines that the message uses the certified delivery protocol, it can discriminate further:

If tibrvMsg_GetCMSequence() returns status code TIBRV_NOT_FOUND, then the listener is not registered for certified delivery from the sender.
If tibrvMsg_GetCMSequence() returns TIBRV_OK, then a certified delivery agreement is in effect for this subject with the sender.

See Also

tibrvcmEvent_CreateListener()

tibrvMsg_GetCMSender()

tibrvMsg_GetCMSequence()

tibrvMsg_GetCMTimeLimit()