TipcMonServerMaxClientLicensesSetWatch


Name

TipcMonServerMaxClientLicensesSetWatch — start or stop watching for the RTserver cloud to exceed the licensed number of RTclient connections

Synopsis

T_BOOL TipcMonServerMaxClientLicensesSetWatch(server_name, watch_status) 
T_STR server_name; 
T_BOOL watch_status; 

Arguments

server_name — name of RTserver to set watch status (wildcard names allowed, or use T_IPC_MON_ALL to indicate a poll of all RTservers matching the value of Monitor_Scope)

watch_status — new watch status (TRUE to start watching, FALSE to stop watching)

Return Values

TRUE if the watch status was successfully set, FALSE otherwise.

Diagnostics

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

Description

TipcMonServerMaxClientLicensesSetWatch sets whether the RTserver is watching for the RTserver cloud to exceed the maximum licensed number of RTclient connections. TipcMonServerMaxClientLicensesSetWatch saves the watch status and sends a MON_SERVER_MAX_CLIENT_LICENSES_SET_WATCH message to the server_name RTserver. The server_name argument can be the unique subject name of a single RTserver, a wildcarded subject name to match many RTservers, or T_IPC_MON_ALL to poll all RTservers that match the value of the Monitor_Scope option.

The watch status controls whether the RTclient receives a MON_SERVER_MAX_CLIENT_LICENSES_STATUS message each time the RTserver exceeds the allowed number of client connections and refuses a new RTclient connection. The watch status is saved internally so the RTclient can automatically resume watching all appropriate categories if RTclient has to reconnect to RTserver.

Each MON_SERVER_MAX_CLIENT_LICENSES_STATUS contains three fields:

Caution

TipcMonServerMaxClientLicensesSetWatch sends a MON_SERVER_MAX_CLIENT_LICENSES_SET_WATCH message to RTserver, but does not explicitly flush the message. See TipcSrvGetAutoFlushSize for more information on message buffering.

RTserver licenses can only be watched, not polled.

See Also

TipcMonServerMaxClientLicensesGetWatch

Examples

This example uses TipcMonServerMaxClientLicensesSetWatch to start watching all RTservers for client connections that were rejected because the maximum number of client licenses is exceeded, and creates a callback to process the incoming MON_SERVER_MAX_CLIENT_LICENSES_STATUS messages:

/* =============================================================== */ 
/*..process_mon_server_max_client_licenses_status – process a 
MON_SERVER_MAX_CLIENT_LICENSESE_STATUS message */ 
 
void process_mon_server_max_client_licenses_status(conn, data, 
arg) 
T_IPC_CONN conn; 
T_IPC_CONN_PROCESS_CB_DATA data; 
T_CB_ARG arg; 
{ 
  T_INT4 max_licenses; 
  T_STR client_name; 
  T_STR server_name; 
 
  /* must set current field first */ 
  if (!TipcMsgSetCurrent(data->msg, 0)) { 
    return; /* error */ 
  } 
 
  /* get the fields from the message */ 
  if (!TipcMsgRead(data->msg, 
                   T_IPC_FT_INT4, &max_licenses, 
                   T_IPC_FT_STR, &client_name, 
                   T_IPC_FT_STR, &server_name, 
                   NULL)) { 
    return; /* error */ 
  } 
 
  TutOut("Got SERVER_MAX_CLIENT_LICENSES status.\n"); 
  TutOut("rejected RTclient name = %s\n", client_name); 
  TutOut("rejecting RTserver name = %s\n", server_name); 
}  /* process_mon_server_max_client_licenses_status */ 
 
/* =============================================================== */ 
/*...code from calling function is below */ 
 
T_IPC_MT mt; 
 
/* send the poll request out to RTserver */ 
if (!TipcMonServerMaxClientLicensesSetWatch ("/...", TRUE))  
  return; /* error */ 
} 
 
mt = 
TipcMtLookupByNum(T_MT_MON_SERVER_MAX_CLIENT_LICENSES_STATUS); 
if (mt == NULL) { 
  return; /* error */ 
} 
 
if (TipcSrvProcessCbCreate(mt,  
                          
process_mon_server_max_client_licenses_status, 
                           NULL) == NULL) { 
  return; /* error */ 
} 
 
/* At this point TipcSrvMainLoop can be used to read and process messages. */ 

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