TipcMsgAppendMsg append a MSG field to a message
msg
message to append field to
msg_data
data for new message field
TRUE
if the field was successfully appended to the message, FALSE
otherwise.
If TipcMsgAppendMsg fails, it returns FALSE
and sets the global SmartSockets error number to one of:
msg
was null or msg_data
was nullmsg
was not a valid message or msg_data
was not a valid messagemsg_data
and msg
were the same message (a message cannot be appended to itself)
TipcMsgAppendMsg appends a MSG field containing msg_data
to the end of a message’s data. TipcMsgAppendMsg makes a copy of the message data.
None
TipcMsgAppendMsgPtr, TipcMsgNextMsg
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 |