The addDirector() method adds a Director to the internal list of Directors that can be used to process requests. Directors are accessed in round-robin order, providing load balancing. If one Director becomes unavailable, the next Director in the list is used, resulting in an automatic failover for Directors.
Syntax
int addDirector (String strHost, int nPort, char cProtocol,
boolean bInFront);
Parameters
Name |
Type |
Use |
Length |
Description |
---|---|---|---|---|
strHost |
String |
In |
n* |
The host name or the IP address of the Director host machine. |
nPort |
int |
In |
4 |
The port number of the Director. The range is 0-65535. |
cProtocol |
char |
In |
1 |
Specifies which transport layer protocol is used. Supported protocols are T (TCP) and U (UDP). |
bInFront |
boolean |
In |
1 |
True = Add the Director to the front of the internal list. False = Add the Director to the end of the internal list. |
n* indicates maximum allowable file path and name length for the operating system on which the program runs.
Return Values
A returned value of 0 indicates that the Director was successfully added. For any non-zero returned value, refer to Return Values for a description of the error.
Example
int nRC;
nRC = addAddDirector(“10.70.245.11”, 1960, ‘T’, true);
Before | After |
---|---|
10.70.245.10, 1950, T | 10.70.245.11, 1960, T |
10.70.245.90, 1970, U | 10.70.245.10, 1950, T |
10.70.245.45, 1980, T | 10.70.245.90, 1970, U |
10.70.245.45, 1980, T |