tibrvMsg_GetCMSequence()
Function
Declaration
tibrv_statustibrvMsg_GetCMSequence
(
tibrvMsg message,
tibrv_u64* sequenceNumber);
Purpose
Extract the sequence number from a certified message.
Remarks
Rendezvous certified delivery sending functions automatically generate positive sequence numbers for outbound labeled messages.
Parameter |
Description |
|
Extract the sequence number from this message. |
|
The program supplies a location. The function stores the sequence number in that location. |
Status
This function returns a status code that discriminates between certified messages (with a certified delivery agreement) and other messages.
• | If the message is from a CM sender, and the CM listener is registered for certified delivery with that sender, then tibrvMsg_GetCMSequence() returns the status code TIBRV_OK and yields a valid sequence number. |
• | If the message is from a CM sender, but the listener is not registered for certified delivery, then tibrvMsg_GetCMSequence() in the context of a tibrvcmEventCallback function returns the status code TIBRV_NOT_FOUND. (In any other context, it returns the actual sequence number stored on the message.) |
Notice that the first labeled message that a program receives on a subject might not be certified; that is, the sender has not registered a certified delivery agreement with the listener. If appropriate, the certified delivery library automatically requests that the sender register the listener for certified delivery. (See Discovery and Registration for Certified Delivery in
.)A labeled but uncertified message can also result when the sender explicitly disallows or removes the listener.
• | If the message is not from a CM sender, then tibrvMsg_GetCMSequence() (in any context) returns the status code TIBRV_NOT_FOUND. |
Release 5 Interaction
In release 6 (and later) the sequence number is a 64-bit unsigned integer, while in older releases (5 and earlier) it is a 32-bit unsigned integer.
When 32-bit senders overflow the sequence number, behavior is undefined.
When 64-bit senders send sequence numbers greater than 32 bits, 32-bit receivers detect malformed label information, and process the message as an ordinary reliable message (uncertified and unlabeled).