TipcSrvMainLoop


Name

TipcSrvMainLoop — read and process messages on the connection to RTserver

Synopsis

T_BOOL TipcSrvMainLoop(timeout) 
T_REAL8 timeout; 

Arguments

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

Return Values

TRUE if all pending messages were successfully processed on the connection to RTserver, FALSE otherwise.

Diagnostics

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

Description

TipcSrvMainLoop reads and processes messages on the connection to RTserver by calling TipcConnMainLoop. TipcSrvMainLoop is a convenience function that can be used in many situations instead of TipcSrvMsgNext, TipcSrvMsgProcess, and TipcMsgDestroy. See TipcConnMainLoop for more information on reading and processing messages.

If an error occurs, TipcSrvMainLoop by default restarts RTserver and return FALSE. To use TipcSrvMainLoop with a timeout of T_TIMEOUT_FOREVER, wrap an extra forever loop, either for (;;) or while (1), around the call to TipcSrvMainLoop.

TipcSrvMainLoop may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, TipcSrvMainLoop processes messages on the warm connection. See TipcSrvCreate on automatic creation of connections and warm connections to RTserver.

Caution

None

See Also

TipcConnMainLoop, TipcMsgDestroy, TipcSrvMsgNext, TipcSrvMsgProcess

Examples

This example creates a connection to RTserver, then reads and processes messages forever with TipcSrvMainLoop (note the use of TipcSrvMainLoop in a loop):

if (!TipcSrvCreate(T_IPC_SRV_CONN_FULL)) { 
  return;  /* error */ 
}  
 
for (;;) { 
  if (!TipcSrvMainLoop(T_TIMEOUT_FOREVER)) { 
    return;  /* error */ 
  }  
} 

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