Messages


Messages are packets of information sent from one process to one or more other processes providing instructions or data for the receiving process. Messages are described in detail in the TIBCO SmartSockets User’s Guide.

The fields in a message can be traversed with the function TipcMsgTraverse. It uses a traversal function defined in this way:

typedef T_PTR (*T_IPC_MSG_TRAV_FUNC) 
   (T_IPC_MSG msg, T_IPC_MSG_TRAV field, T_PTR arg); 

For more information on traversal functions, see the TIBCO SmartSockets Utilities reference. The traversal function for TipcMsgTraverse must be defined with these arguments. The second argument to the traversal function contains information for a field in a message. The the data structure for this argument is defined:

typedef struct T_IPC_MSG_TRAV_STRUCT T_IPC_MSG_TRAV_STRUCT, 
   *T_IPC_MSG_TRAV; 
struct T_IPC_MSG_TRAV_STRUCT { 
   T_INT2 *type_ptr;            /* stored as 2 bytes in message */ 
   T_PTR value_ptr;             /* can be cast to appropriate type */ 
   T_INT4 *array_size_ptr;      /* NULL if not applicable */ 
   T_IPC_MSG_FIELD field;       /* actual field */ 
}; 

The field type in a message is stored as a 2-byte integer (to save space), but should be referenced in code with the enumerated type T_IPC_FT. This is how the T_IPC_FT type is defined:

typedef enum { 
  T_IPC_FT_INVALID, 
  T_MSG_FT_CHAR, 
  T_MSG_FT_BINARY, 
  T_MSG_FT_STR, 
  T_IPC_FT_STR_ARRAY, 
  T_IPC_FT_INT2, 
  T_IPC_FT_INT2_ARRAY, 
  T_IPC_FT_INT4, 
  T_IPC_FT_INT4_ARRAY, 
  T_IPC_FT_INT8, 
  T_IPC_FT_INT8_ARRAY, 
  T_IPC_FT_REAL4, 
  T_IPC_FT_REAL4_ARRAY, 
  T_IPC_FT_REAL8, 
  T_IPC_FT_REAL8_ARRAY, 
  T_IPC_FT_REAL16, 
  T_IPC_FT_REAL16_ARRAY, 
  T_IPC_FT_MSG, 
  T_IPC_FT_MSG_ARRAY 
  T_MSG_FT_XML, 
  T_MSG_FT_TIMESTAMP, 
  T_MSG_FT_TIMESTAMP_ARRAY, 
  T_MSG_FT_UTF8, 
  T_MSG_FT_UTF8_ARRAY, 
  T_MSG_FT_BOOL, 
  T_MSG_FT_BOOL_ARRAY, 
  T_MSG_FT_BYTE 
 
}  T_IPC_FT; 

The T_IPC_PROP_* enumerated values are not field types, but instead allow a message property to be accessed with the convenience functions TipcMsgRead, TipcMsgReadVa, TipcMsgWrite, TipcMsgWriteVa, TipcConnMsgWrite, TipcConnMsgWriteVa, TipcSrvMsgWrite, and TipcSrvMsgWriteVa.

Both messages and message types have a delivery mode property that controls what level of guarantee is used when a message is sent through a connection with TipcConnMsgSend. This is how the enumerated type used to identify this property is defined:

typedef enum { 
       T_IPC_DELIVERY_BEST_EFFORT,  /* network failure can cause loss */ 
   T_IPC_DELIVERY_SOME,                   /* guaranteed to deliver to at least one */ 
   T_IPC_DELIVERY_ALL,           /* guaranteed to deliver to all receivers */ 
   T_IPC_DELIVERY_ORDERED         /* despite failure, delivers in order published */ 
}  T_IPC_DELIVERY_MODE; 

Both messages and message types have a load balancing mode property that controls how a publish-subscribe message is load balanced. This is how the enumerated type used to identify this property is defined:

typedef enum { 
       T_IPC_LB_NONE,        /* normal publish subscribe delivery mode */ 
   T_IPC_LB_ROUND_ROBIN, /* RoundRobin load balancing */ 
   T_IPC_LB_WEIGHTED,   /* weighted RoundRobin load balancing(based on GMD acks)*/ 
   T_IPC_LB_SORTED       /* sorted load balancing */ 
}  T_IPC_LB_MODE; 

TIBCO SmartSockets™ API Quick Reference
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com