TipcMsgNextTimestamp get a TIMESTAMP field from a message
msg
message to get field from
timestamp_return
storage for TIMESTAMP value from field
TRUE
if the field was successfully retrieved from the message, FALSE
otherwise.
If TipcMsgNextTimestamp fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcMsgNextTimestamp retrieves the value of the current field of a message, which must be a TIMESTAMP (eight-byte real number) field. A timestamp is the current computer wall clock time in the number of seconds since midnight January 1, 1970. If TipcMsgNextTimestamp succeeds, it advances the current field to the next field in the message.
TipcMsgNextTimestamp converts the field into the data format used by this process if necessary.
If TipcMsgNextTimestamp returns FALSE
, it does not store a value in timestamp_return
.
This example creates a message, appends a TIMESTAMP field, and reads the field back from the message:
T_IPC_MT mt; T_IPC_MSG msg; T_REAL8 timestamp_val; #define USER_MT_TIMESTAMP_TEST 100 mt = TipcMtCreate("timestamp_test", USER_MT_TIMESTAMP_TEST, "timestamp"); if (mt == NULL) {return
; /* error */
} msg = TipcMsgCreate(mt); if (msg == NULL) {return
; /* error */
} if (!TipcMsgAppendTimestamp(msg, TutGetWallTime())) {return
; /* error */
} if (!TipcMsgSetCurrent(msg, 0)) {return
; /* error */
} if (!TipcMsgNextTimestamp(msg, ×tamp_val)) {return
; /* error */
} TutOut("timestamp_val = %s\n", TutRealToStr(timestamp_val));
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |