TipcMsgPrintError


Name

TipcMsgPrintError — report an error about an unexpected message

Synopsis

T_BOOL TipcMsgPrintError(msg) 
T_IPC_MSG msg; 

Arguments

msg — message for error report

Return Values

TRUE if the error report was successfully output, FALSE otherwise.

Diagnostics

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

Description

TipcMsgPrintError is used to report an error for an unexpected message. An unexpected message is one that has no connection process callbacks for the message’s type. Call TipcMsgPrintError with a connection default callback, as these callbacks are called only for message types without any process callbacks. The first line of the error report has the form:

WARNING: Received unwanted message at time time. 
 

The time printed is the current data time from TutGetCurrentTime, and it is printed using the format specified in the option Time_Format. TipcMsgPrintError then prints the contents of the message with TipcMsgPrint.

Caution

None

See Also

TipcConnDefaultCbCreate, TipcSrvDefaultCbCreate

Examples

This example creates a message default callback that uses TipcMsgPrintError to inform the user of an unexpected message from RTserver:

static void T_ENTRY default_cb(conn, data, arg) 
T_IPC_CONN conn; 
T_IPC_CONN_DEFAULT_CB_DATA data; 
T_CB_ARG arg; 
{ 
  if (!TipcMsgPrintError(data->msg)) { 
    return;  /* error */ 
  }  
} /* default_cb */ 
 
/* =========================================================== */ 
/*...code from calling function is below */ 
if (TipcSrvDefaultCbCreate(default_cb, NULL)) { 
  return;  /* error */ 
}  

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