TsgcWebSocketLoadBalancerServerMethods › Stop

Stop Method

Stops the load balancer from a secondary thread so the calling thread is not blocked while connections are closed.

Syntax

procedure Stop;

Remarks

Stop spawns an internal worker thread that sets Active := False, so the caller returns immediately instead of blocking while every active client and every backup-server link is torn down. The load balancer closes its listening sockets and calls DisconnectAll internally to drop open connections; registered backup servers detect the disconnection and, when configured with AutoRestart, will reconnect once the load balancer is started again. Subscribe to OnShutdown to be notified once the load balancer has fully stopped and no further connections are accepted. Use the Active property directly if you prefer a synchronous shutdown that runs on the calling thread.

Example


oServer.Stop();

Back to Methods