TsgcWebSocketClient › Properties › LoadBalancer
Connects to a sgcWebSockets Load Balancer server or to a manually defined pool of WebSocket servers.
property LoadBalancer: TsgcWSLoadBalancerClient_Options read FLoadBalancer write SetLoadBalancer;
Enabled=False
When Enabled is True the client contacts the Load Balancer server specified by Host and Port to discover a target WebSocket server and to broadcast messages across nodes. Alternatively populate Servers with a static list of WebSocket endpoints (for example http://127.0.0.1:80) to be used without contacting the balancer. The OnLoadBalancerError event is raised when communication with the balancer fails.
oClient := TsgcWebSocketClient.Create(nil);
oClient.LoadBalancer.Enabled := true;
oClient.LoadBalancer.Host := '127.0.0.1';
oClient.LoadBalancer.Port := 5412;
oClient.Active := true;