TipcSrvMsgNext


Name

TipcSrvMsgNext — get the next message from the connection to RTserver

Synopsis

T_IPC_MSG TipcSrvMsgNext(timeout) 
T_REAL8 timeout; 

Arguments

timeout — maximum number of seconds to wait for message to arrive

Return Values

A message if successful, NULL otherwise.

Diagnostics

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

Description

TipcSrvMsgNext gets the next message from the connection to RTserver by calling TipcConnMsgNext. A connection has a priority queue of incoming messages. See TipcConnMsgNext for more information on getting messages from a connection’s message queue.

TipcSrvMsgNext may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, and if a message is immediately available, TipcSrvMsgNext gets the next message from the warm connection. If no messages are queued in the warm connection, then TipcSrvMsgNext calls TutSleep with timeout, so that RTclient does not use an abnormal amount of CPU time. See TipcSrvCreate on automatic creation of connections and warm connections to RTserver.

Caution

Call TipcMsgDestroy to destroy the message returned by TipcSrvMsgNext when it is no longer needed, unless the message is passed to another function which takes responsibility for destroying the message (such as TipcSrvMsgInsert).

RTclients that receive messages with TipcSrvMsgNext or TipcSrvMsgSearch but do not call TipcSrvMsgProcess on those message are not monitorable with the TipcMon* API or RTmon. RTclient monitoring is implemented using connection process callbacks, which are all called by TipcSrvMsgProcess.

See Also

TipcConnMsgNext, TipcSrvMsgProcess, TipcSrvMainLoop, TipcSrvRead

Examples

This example waits for up to 10 seconds to get the next message from the connection to RTserver, processes the message, and finally destroys the message:

T_IPC_MSG msg; 
 
msg = TipcSrvMsgNext(10.0); 
if (msg == NULL) { 
  return;  /* error */ 
}  
 
if (!TipcSrvMsgProcess(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