TsgcWebSocketServerProperties › LoadBalancer

LoadBalancer Property

Configures the built-in client used to register this server with a Load Balancer Server instance.

Syntax

property LoadBalancer: TsgcWSLoadBalancerServer_Options read FLoadBalancer write SetLoadBalancer;

Default Value

Enabled=False

Remarks

Enable the load-balancer client to let this server publish its bindings to a central TsgcWSLoadBalancerServer so that the load balancer can route new clients to it and relay broadcast messages. AutoRegisterBindings automatically advertises the bindings configured on this server; alternatively fill the Bindings list manually with entries in WS://host:port or WSS://host:port form. AutoRestart sets the number of seconds to wait before reconnecting after a load-balancer disconnection (0 disables auto-restart). Guid identifies this server on the load-balancer side; Host and Port point to the load-balancer endpoint. The events OnLoadBalancerConnect, OnLoadBalancerDisconnect and OnLoadBalancerError report connection state.

Example


oServer := TsgcWebSocketServer.Create(nil);
oServer.LoadBalancer.Host := 'lb.example.com';
oServer.LoadBalancer.Port := 80;
oServer.LoadBalancer.AutoRegisterBindings := true;
oServer.LoadBalancer.Enabled := true;
oServer.Active := true;

Back to Properties