TipcSrvGetNumQueued


Name

TipcSrvGetNumQueued — get number of queued messages from the connection to RTserver

Synopsis

T_BOOL TipcSrvGetNumQueued(num_queued_return) 
T_INT4 *num_queued_return; 

Arguments

num_queued_return — storage for number of queued messages

Return Values

TRUE if number of queued messages was successfully retrieved from the connection to RTserver, FALSE otherwise.

Diagnostics

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

Description

TipcSrvGetNumQueued gets the number of queued messages from the connection to RTserver by calling TipcConnGetNumQueued. A connection has a priority queue of incoming messages. See TipcConnGetNumQueued for more information on connection message queues.

TipcSrvGetNumQueued may attempt to automatically create a connection to RTserver. If RTclient has a warm connection to RTserver, TipcSrvGetNumQueued gets the number of queued messages from the warm connection. See TipcSrvCreate on automatic creation of connections and warm connections to RTserver.

Caution

If TipcSrvGetNumQueued returns FALSE, it does not store a value in num_queued_return.

See Also

TipcConnGetNumQueued, TipcSrvMsgNext, TipcSrvMainLoop, TipcSrvRead

Examples

This example prints the number of queued messages, then reads from the connection to RTserver until at least three messages are available:

T_INT4 num_queued; 
if (!TipcSrvGetNumQueued(&num_queued)) { 
  return;  /* error */ 
}  
TutOut("The connection to RTserver has %d queued messages.\n", 
       num_queued); 
 
while (num_queued < 3) { 
  if (!TipcSrvRead(T_TIMEOUT_FOREVER)) { 
    return;  /* error */ 
  }  
  if (!TipcSrvGetNumQueued(&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