TipcSrvMonClientNamesNumPoll


Name

TipcSrvMonClientNamesNumPoll — poll for the number of RTclients in the current project that match the value of the Monitor_Scope option

Synopsis

T_BOOL TipcSrvMonClientNamesNumPoll(srv) 
T_IPC_SRV srv; 

Arguments

srv — connection handle to RTserver

Return Values

TRUE if the poll for the number of RTclients was successfully initiated, FALSE otherwise.

Diagnostics

If TipcSrvMonClientNamesNumPoll fails, it returns FALSE and sets the global SmartSockets error number to:

Description

TipcSrvMonClientNamesNumPoll polls for the number of RTclients in the current project that match the value of the Monitor_Scope option by sending a MON_CLIENT_NAMES_NUM_POLL_CALL to the RTserver. The srv argument indicates the connection on which the poll is to be sent.

The RTserver responds by sending back a MON_CLIENT_NAMES_NUM_POLL_RESULT message. Each MON_CLIENT_NAMES_NUM_POLL_RESULT message contains one field:

If there are no RTclients in the project that match the value of Monitor_Scope, the MON_CLIENT_NAMES_NUM_POLL_RESULT message gives 0 for the number of clients.

Caution

TipcSrvMonClientNamesNumPoll sends a MON_CLIENT_NAMES_NUM_POLL_CALL message to RTserver, but does not explicitly flush the message. See TipcSrvConnGetAutoFlushSize for more information on message buffering.

The number of RTclients can only be polled, not watched.

See Also

TipcSrvMonClientNamesPoll

Examples

This example uses TipcSrvMonClientNamesNumPoll to poll for the number of RTclient names, waits up to 10 seconds for the poll result, and then prints the poll result message:

T_IPC_MT mt; 
T_IPC_MSG msg; 
T_INT4 num_client_names; 
 
/* send the poll request out to RTserver */ 
if (!TipcSrvMonClientNamesNumPoll(srv)) { 
  return;  /* error */ 
} 
 
mt = TipcMtLookupByNum(T_MT_MON_CLIENT_NAMES_NUM_POLL_RESULT); 
if (mt == NULL) { 
  return;  /* error */ 
} 
 
/* wait up to 10 seconds for the poll result */ 
msg = TipcSrvConnMsgSearchType(srv, 10.0, mt); 
if (msg == NULL) { 
  return;  /* error */ 
} 
 
/* set the current field to the first field */ 
if (!TipcMsgSetCurrent(msg, 0)) { 
  return;  /* error */ 
} 
 
if (!TipcMsgNextInt4(msg, &num_client_names)) { 
  return;  /* error */ 
} 
 
TutOut("Got CLIENT_NAMES_NUM poll result.\n"); 
TutOut("number of client names = %d\n", num_client_names); 
 
/* clean up */ 
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