Login redirection and extended HA failover support allows a cluster of servers to perform load-balancing for all incoming client connections.
Three routines support this functionality: srv_send_ctlinfo, srv_getserverbyname, and srv_freeserveraddrs.
The srv_send_ctlinfo routine supports both login redirection and extended HA failover and srv_getserverbyname, and srv_freeserveraddrs allows an Open Server application to translate a given server name to its connection information. These routines are described in “srv_send_ctlinfo”, “srv_getserverbyname”, and “srv_freeserveraddrs”.
The following properties support the routines:
SRV_S_HASERVER, a read-only server property that returns the HAFAILOVER value from the interfaces file, which corresponds to the server name as set by srv_init.
SRV_T_REDIRECT, a read-only thread property that returns the setting of the TDS_HA_LOG_REDIRECT bit in the login record.
SRV_T_HA, a thread property that returns the setting of HA-related information from the login record as a CS_INT bitmask. Information provided includes session (SRV_HA_LOGIN), failover (SRV_HA_LOGIN_FAILOVER), and resume (SRV_HA_LOGIN_RESUME) bits.
CS_SESSIONID, a type definition that holds the Session ID.
SRV_T_SESSIONID, returns the Session ID that the client sends to Open Server in the login record.
You can also use SRV_T_SESSIONID to send a Session ID to the client in the SRV_CONNECT handler. See “Instructing clients to migrate to a different server”.
SRV_NEG_SESSIONID, a type of negotiated login information in the parlance of srv_negotiate that supports the sending of client Session ID information.