TipcMtGetLbMode


Name

TipcMtGetLbMode — get the load balancing mode of a message type

Synopsis

T_BOOL TipcMtGetLbMode(mt, lb_mode_return) 
T_IPC_MT mt; 
T_IPC_LB_MODE *lb_mode_return; 

Arguments

mt— message type to get load balancing mode from

lb_mode_return — storage for message type load balancing mode

Return Values

TRUE if the load balancing mode was successfully retrieved from the message type, FALSE otherwise.

Diagnostics

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

Description

TipcMtGetLbMode gets the load balancing mode of a message type. The load balancing mode of a message controls how (or if) the message is load balanced among RTclients subscribed to a load balanced subject. The load balancing mode of a message type is used as the default load balancing mode for messages of this type. When a message is created, its load balancing mode is initialized to the message type load balancing mode. See TipcMsgGetLbMode for more information on message load balancing modes.

The load balancing mode of an outgoing message can always be set on a per-message basis, but using message type load balancing modes makes it easier to change the default load balancing mode for all outgoing messages of a specific type. The standard SmartSockets message types by default all have a load balancing mode of T_IPC_LB_NONE, but these can be changed. User-defined message types can also use whatever load balancing mode is appropriate.

Caution

If TipcMtGetLbMode returns FALSE, it does not store a value in lb_mode_return.

See Also

TipcMtSetLbMode, TipcMtGetLbMode

Examples

This example prints the load balancing mode of the NUMERIC_DATA message type:

T_IPC_MT mt; 
T_IPC_LB_MODE lb_mode; 
T_STR lb_mode_str; 
 
mt = TipcMtLookup("numeric_data"); 
if (mt == NULL) { 
  return;  /* error */ 
} 
 
if (!TipcMtGetLbMode(mt, &lb_mode)) { 
  return;  /* error */ 
} 
 
/* convert the load balancing mode to a string to make it easier to read */ 
if (!TipcLbModeToStr(lb_mode, &lb_mode_str)) { 
  return;  /* error */ 
} 
 
TutOut("NUMERIC_DATA msg type has load balancing mode %s\n",  
       lb_mode_str); 

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