TipcMsgAppendMsg


Name

TipcMsgAppendMsg — append a MSG field to a message

Synopsis

T_BOOL TipcMsgAppendMsg(msg, msg_data) 
T_IPC_MSG msg; 
T_IPC_MSG msg_data; 

Arguments

msg — message to append field to

msg_data — data for new message field

Return Values

TRUE if the field was successfully appended to the message, FALSE otherwise.

Diagnostics

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

Description

TipcMsgAppendMsg appends a MSG field containing msg_data to the end of a message’s data. TipcMsgAppendMsg makes a copy of the message data.

Caution

None

See Also

TipcMsgAppendMsgPtr, TipcMsgNextMsg

Examples

This example creates a message and appends a MSG field:

T_IPC_MSG msg; 
T_IPC_MSG msg_data; 
 
#define USER_MT_CONTAINER 100 
 
mt = TipcMtCreate("container", USER_MT_CONTAINER, "msg"); 
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. */ 
 
mt = TipcMtLookupByNum(T_MT_NUMERIC_DATA); 
if (mt == NULL) { 
  return;  /* error */ 
}  
msg_data = TipcMsgCreate(mt); 
if (msg_data == NULL) { 
  return;  /* error */ 
}  
 
if (!TipcMsgAppendStrReal8(msg_data, "speed_limit", 55.0)) { 
  return;  /* error */ 
}  
 
if (!TipcMsgAppendMsg(msg, msg_data)) { 
  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