TipcMsgGetSeqNum get the sequence number of a message
msg
message to get sequence number from
seq_num_return
storage for sequence number
TRUE
if the sequence number was successfully retrieved from the message, FALSE
otherwise.
If TipcMsgGetSeqNum fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcMsgGetSeqNum gets the sequence number of a message. The sequence number is used by GMD to detect duplicate messages. When a message with a delivery mode of T_IPC_DELIVERY_SOME or T_IPC_DELIVERY_ALL is sent through a connection, TipcConnMsgSend increments an internal per-connection sequence number and sets the sequence number of the message to the incremented value. If the message is later resent because of a GMD failure, TipcConnGmdMsgResend preserves the sequence number, which allows the receiving processes to detect the duplicate sequence number and thus avoid processing the same message twice.
If TipcMsgGetSeqNum returns FALSE
, it does not store a value in seq_num_return
.
TipcConnMsgSend, TipcConnGmdMsgResend
This example prints the sequence number of a message:
void T_ENTRY print_seq_num(msg) T_IPC_MSG msg; { T_INT4 seq_num; if (!TipcMsgGetSeqNum(msg, &seq_num)) {return
; /* error */
} TutOut("The message sequence number is %d.\n", seq_num); }/* print_seq_num */
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |