TsgcQUICServer › Methods › Stop

Stop Method

Stops listening, closes every active connection and releases the QUIC listener.

Syntax

procedure Stop;

Remarks

Stop reverses Start: it terminates the background listener thread first (so no thread touches the connections while they are released), marks every active connection as disconnected, clears the connection list (freeing each connection and its SSL object), and finally frees the QUIC listener and the SSL context. It is safe to call even if the server was never started, and it is invoked automatically when the component is destroyed.

Because the connections are cleared rather than closed one by one, OnQUICDisconnect is not raised for the connections dropped by Stop. Do any per-session cleanup before calling it, or from the component's destructor path, not from that event. Every TsgcQUICServerConnection instance is invalid once Stop returns.

Stop is implemented as Active := False, so the two are interchangeable and Active reports False once it returns. When the server was actually listening, OnShutdown is raised at the end of the teardown, before Stop returns. Stopping an already stopped server does nothing and stays silent, so the event is not raised twice.

Example

oServer.Stop;

Back to Methods