TsgcUDPServerMethods › Stop

Stop Method

Stops the server from a secondary thread so the calling thread is not blocked while the listener is torn down.

Syntax

procedure Stop;

Remarks

Stop spawns an internal worker thread that sets Active := False, so the caller returns immediately instead of blocking while the listener sockets are closed and any cached DTLS session is discarded. Subscribe to OnShutdown to be notified once the server has fully stopped and no further datagrams are accepted. The watchdog timer is also disabled so a stopped server will not be automatically restarted. Use the Active property directly if you prefer a synchronous shutdown that runs on the calling thread.

Example

oServer.Stop;

Back to Methods