TipcSrvMonClientExtPoll


Name

TipcSrvMonClientExtPoll — poll for extension data of an RTclient

Synopsis

T_BOOL TipcSrvMonClientExtPoll(srv, client_name) 
T_IPC_SRV srv; 
T_STR client_name; 

Arguments

srv — connection handle to the RTserver

client_name — name of the RTclient to retrieve extension data from. The value of client_name can be:

Return Values

TRUE if the poll for RTclient extension data was successfully initiated, FALSE otherwise.

Diagnostics

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

Description

TipcSrvMonClientExtPoll 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.

See Also

Use the necessary TipcSrvMonExt* APIs to define extension data in each RTclient that is requested by TipcSrvMonClientExtPoll.

Examples

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; 
  TipcSrvMonExtSetReal4(srv1,"account_balance",balance); 
  TipcSrvConnMainLoop(srv1,T_TIMEOUT_FOREVER); 
  TipcSrvMonExtDelete(srv1,"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); 
  } 
} 
. 
. 
. 
  TipcSrvConnProcessCbCreate(srv2, 
    TipcMtLookupByNum(T_MT_MON_CLIENT_EXT_POLL_RESULT), 
    ext_poll_result_cb,T_NULL); 
  TipcSrvMonClientExtPoll(srv2,T_IPC_MON_ALL); 
  TipcSrvConnMainLoop(srv2,T_TIMEOUT_FOREVER); 
. 
. 
. 
 
 

TIBCO SmartSockets™ Application Programming Interface
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com