TipcMonClientExtPoll poll for extension data of an RTclient
client_name
name of the RTclient to retrieve extension data from. The value of client_name
can be:
TRUE
if the poll for RTclient extension data was successfully initiated, FALSE
otherwise.
If TipcMonClientExtPoll fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcMonClientExtPoll requests extension data from one or more RTclients by sending a message of type MON_CLIENT_EXT_POLL_CALL to those RTclients. Extension data is defined as any information generated by an RTclient which another RTclient wants to monitor. The extension data is not generated by SmartSockets.
One or more RTclients respond to a MON_CLIENT_EXT_POLL_CALL message by returning their data in a message of type MON_CLIENT_EXT_POLL_RESULT.
Use the necessary TipcMonExt* APIs to define extension data in each RTclient that is requested by TipcMonClientExtPoll.
In this example, RTclient1 copies the value of its balance
field (100.0
) into the field called account_balance
in its MON_CLIENT_EXT_POLL_RESULT message. RTclient2 requests the account information from RTclient 1 with TipcMonClientExtPoll and prints the account balance:
RTclient 1:
. . . T_REAL4 balance=100.0; TipcMonExtSetReal4("account_balance",balance); TipcSrvMainLoop(T_TIMEOUT_FOREVER); TipcMonExtDelete("account_balance");. . . .
RTclient 2
.
.
.
void T_ENTRY ext_poll_result_cb
(
T_IPC_CONN conn,
T_IPC_CONN_MSG_CB_DATA data,
T_PTR arg
)
{
T_STR client;
T_REAL4 account_balance = 0;
T_INT4 num_named_fields = 0;
T_BOOL has_account_balance;
TipcMsgSetCurrent(data->msg,0);
TipcMsgNextStr(data->msg,&client);
TipcMsgNextInt4(data->msg,&num_named_fields);
/* Get "account_balance" extension data from RTclient1 */
has_account_balance = TipcMsgGetNamedReal4(data->msg,
"account_balance",
&account_balance);
if (T_TRUE == has_account_balance) {
TutOut("Client %s has an account balance of %f dollars.\n",
client,
account_balance);
}
}
.
.
.
TipcSrvProcessCbCreate(
TipcMtLookupByNum(T_MT_MON_CLIENT_EXT_POLL_RESULT),
ext_poll_result_cb,T_NULL);
TipcMonClientExtPoll(T_IPC_MON_ALL);
TipcSrvMainLoop(T_TIMEOUT_FOREVER);
.
.
.
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |