TipcConnMsgProcess


Name

TipcConnMsgProcess — process a message in a connection

Synopsis

T_BOOL TipcConnMsgProcess(conn, msg) 
T_IPC_CONN conn; 
T_IPC_MSG msg; 

Arguments

conn — connection to process message in

msg — message to be processed

Return Values

TRUE if message was successfully processed, FALSE otherwise.

Diagnostics

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

Description

TipcConnMsgProcess processes a message in a connection by calling the process callbacks or default callbacks. The default callbacks are only called if there are no non-global process callbacks for the type of message being processed.

Processing a message with two levels of callbacks allows for more flexibility. For example, RTserver creates a few process callbacks for the message types it needs to process locally (such as SUBJECT_SET_SUBSCRIBE), but the majority of the message types (such as NUMERIC_DATA) are simply routed to their destination by a default callback.

Any message can be processed by TipcConnMsgProcess, not just messages read from a connection. For example, a generic message file data source could be implemented which read messages from a file with TipcMsgFileRead and then processed those same messages with TipcConnMsgProcess.

Caution

The T_ENTRY declaration specifier is required in the definition of all callback functions as well as their prototypes.

See Also

TipcConnDefaultCbCreate, TipcConnMsgNext, TipcConnMainLoop, TipcConnProcessCbCreate

Examples

This example gets the next message from a connection, processes it with TipcConnMsgProcess, and finally destroys the message:

msg = TipcConnMsgNext(conn, T_TIMEOUT_FOREVER); 
if (msg == NULL) { 
  return;  /* error */ 
}  
 
if (!TipcConnMsgProcess(conn, msg)) { 
  return;  /* error */ 
} 
 
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