TipcSrvMonClientNamesNumPoll poll for the number of RTclients in the current project that match the value of the Monitor_Scope option
srv
connection handle to RTserver
TRUE
if the poll for the number of RTclients was successfully initiated, FALSE
otherwise.
If TipcSrvMonClientNamesNumPoll fails, it returns FALSE
and sets the global SmartSockets error number to:
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.
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.
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 |