TipcMsgAppendStrReal8


Name

TipcMsgAppendStrReal8 — append a STR field and a REAL8 field to a message

Synopsis

T_BOOL TipcMsgAppendStrReal8(msg, str_data, real8_data) 
T_IPC_MSG msg; 
T_STR str_data; 
T_REAL8 real8_data; 

Arguments

msg — message to append fields to

str_data — data for new message field

real8_data — data for new message field

Return Values

TRUE if the fields were successfully appended to the message, FALSE otherwise.

Diagnostics

If TipcMsgAppendStrReal8 fails, it returns FALSE and sets the global SmartSockets error number to one of:

Description

TipcMsgAppendStrReal8 is a convenience function that appends both a STR field and a REAL8 field to the end of a message’s data. TipcMsgAppendStrReal8 is useful for constructing NUMERIC_DATA messages. The NUMERIC_DATA message type is often the most frequently used message type in SmartSockets.

Using TipcMsgAppendStrReal8 is slightly faster than using TipcMsgAppendStr and TipcMsgAppendReal8.

Caution

None

See Also

TipcMsgNextStrReal8

Examples

This example creates a message and appends STR and REAL8 fields:

T_IPC_MT mt; 
T_IPC_MSG msg; 
 
mt = TipcMtLookupByNum(T_MT_NUMERIC_DATA); 
if (mt == NULL) { 
  return;  /* error */ 
}  
 
msg = TipcMsgCreate(mt); 
if (msg == NULL) { 
  return;  /* error */ 
}  
 
/* An RTclient would typically set the destination of */ 
/* a message at this point by calling TipcMsgSetDest. */ 
 
if (!TipcMsgAppendStrReal8(msg, "voltage", 120.0)) { 
  return;  /* error */ 
}  
 
/* A process would typically send a message at this point by */ 
/* calling TipcConnMsgSend or TipcSrvMsgSend. */ 
 
/* A process would typically destroy a message at this point by */ 
/* calling TipcMsgDestroy. */ 

TIBCO SmartSockets™ Application Programming Interface
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com