TipcMsgCreate


Name

TipcMsgCreate — create a new message

Synopsis

T_IPC_MSG TipcMsgCreate(mt) 
T_IPC_MT mt; 

Arguments

mt — message type

Return Values

New message if successful, NULL otherwise.

Diagnostics

If TipcMsgCreate fails, it returns NULL and sets the global SmartSockets error number to:

Description

TipcMsgCreate creates a new message with the desired type, with these properties:

Caution

When the message returned by TipcMsgCreate is no longer needed, destroy it by calling TipcMsgDestroy, unless the message is passed to another function which takes responsibility for destroying the message, such as TipcSrvMsgInsert.

See Also

TipcMsgDestroy

Examples

This example creates a message, appends two fields, and destroys the message:

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, "speed_limit", 55.0)) { 
  return;  /* error */ 
}  
 
/* A process would typically send a message at this point by */ 
/* calling TipcConnMsgSend or TipcSrvMsgSend. */ 
 
if (!TipcMsgDestroy(msg)) { 
  return;  /* error */ 
}  

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