TipcConnGetNumQueued get number of queued messages from a connection
conn
connection from which to get number of queued messages
num_queued_return
storage for number of queued messages
TRUE
if number of queued messages was successfully retrieved from connection, FALSE
otherwise.
If TipcConnGetNumQueued fails, it returns FALSE
and sets the global SmartSockets error number to:
TipcConnGetNumQueued gets the number of queued messages from a connection. A connection has a priority queue of incoming messages. Messages are inserted into the queue with TipcConnMsgInsert (TipcConnRead uses TipcConnMsgInsert to insert newly read messages), may be removed from the front of the queue with TipcConnMsgNext, and may be removed from anywhere in the queue with TipcConnMsgSearch.
If TipcConnGetNumQueued returns FALSE
, it does not store a value in num_queued_return
.
TipcConnMsgNext, TipcConnMainLoop, TipcConnRead
This example prints the number of queued messages, then reads from a connection until at least three messages are available:
T_INT4 num_queued; if (!TipcConnGetNumQueued(conn, &num_queued)) {
return
; /* error */
} TutOut("The connection has %d queued messages.\n", num_queued); while (num_queued < 3) { if (!TipcConnRead(conn, T_TIMEOUT_FOREVER)) {
return
; /* error */
} if (!TipcConnGetNumQueued(conn, &num_queued)) {
return
; /* error */
} }
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |