TsgcWebSocketProxyServer › Events › OnLoadBalancerConnect
Fires when the proxy server connects to the Load Balancer Server.
property OnLoadBalancerConnect: TsgcWSConnectEvent;
// TsgcWSConnectEvent = procedure(Connection: TsgcWSConnection) of object
—
When LoadBalancer.Enabled is True the proxy server opens a side connection to the Load Balancer Server identified by LoadBalancer.Host and LoadBalancer.Port, in order to broadcast messages across a cluster and publish its own bindings. OnLoadBalancerConnect is raised once that side connection has been established and the proxy has been registered. The Connection parameter is the TsgcWSConnection against the Load Balancer Server; this event does not fire for downstream clients connecting to the proxy.
procedure OnLoadBalancerConnect(Connection: TsgcWSConnection);
begin
WriteLn('#load balancer connected: ' + Connection.PeerIP);
end;