TipcConnMainLoop read and process messages on a connection
conn
connection to read and process messages on
timeout
maximum number of seconds to wait for message to arrive
TRUE
if all pending messages were successfully processed on the connection, FALSE
otherwise.
If TipcConnMainLoop fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcConnMainLoop reads and processes messages on a connection. TipcConnMainLoop is a convenience function that keeps calling TipcConnMsgNext with the time remaining from timeout until TipcConnMsgNext returns FALSE
. For each message that TipcConnMainLoop gets, it processes the message with TipcConnMsgProcess and then destroys the message with TipcMsgDestroy. Use 0.0
for timeout to poll the connection and catch up on all pending messages that have accumulated. Use T_TIMEOUT_FOREVER for timeout to read and process messages indefinitely.
As soon as TipcConnMsgNext returns FALSE, TipcConnMainLoop returns. If TipcConnMsgNext sets the global SmartSockets error number to T_ERR_TIMEOUT_REACHED (the timeout period was reached) or T_ERR_WOULD_BLOCK (the connection is in non-blocking mode with timeouts disabled), then TipcConnMainLoop returns TRUE
; otherwise it returns FALSE
. See TipcConnRead for more information on these error numbers.
None
TipcConnMsgNext, TipcConnMsgProcess
This example does a time-consuming calculation, then catches up on its messages with TipcConnMainLoop:
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |