TipcMsgPrint


Name

TipcMsgPrint — print all information about of a message in portable, reproducible format

Synopsis

T_BOOL TipcMsgPrint(msg, func) 
T_IPC_MSG msg; 
T_OUT_FUNC func; 

Arguments

msg — message to print

func — TutOut-style output function

Return Values

TRUE if the message was successfully printed, FALSE otherwise.

Diagnostics

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

Description

TipcMsgPrint prints all information about a message in a portable, reproducible format to a TutOut-style output function. The output function is called once for each line of output.

TipcMsgPrint first prints the non-data properties of the message, such as the type and destination. TipcMsgPrint then prints the message data, two lines for each field. The first lines shows the field type, and the second line the field value.

Caution

None

See Also

TutOut (see the TIBCO SmartSockets Utilities)

Examples

This example creates a message, appends fields, and prints 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 */ 
}  
 
if (!TipcMsgAppendStrReal8(msg, "speed_limit", 65.0)) { 
  return;  /* error */ 
}  
 
if (!TipcMsgPrint(msg, TutOut)) { 
  return;  /* error */ 
}  

The output from the above example is similar to:

type = numeric_data 
sender = <(NULL)> 
dest = <(NULL)> 
max = 2048 
size = 44 
current = 0 
read_only = false 
priority = 0 
delivery_mode = best_effort 
ref_count = 1 
seq_num = 0 
resend_mode = false 
user_prop = 0 
data (num_fields = 2): 
  str "speed_limit" 
  real8 65 

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