TsgcQUICServer › Properties › Active
Reports and drives the QUIC listener. Setting it is equivalent to calling Start or Stop.
property Active: Boolean read GetActive write SetActive;
False
Active is inherited from the UDP server base class, and TsgcQUICServer overrides both its getter and its setter so that it reports and drives the OpenSSL QUIC listener instead of the inherited Indy UDP server, which this component never uses. It is not published, so it does not appear in the Object Inspector, but it is public and can be used from code:
True once the QUIC listener is bound, so it is True after a successful Start and False after Stop or a failed start. While the component is being designed or loaded, it reports the streamed value instead.Active := True performs the same bring-up as Start, including raising on a bad configuration, and Active := False performs the same teardown as Stop.Start is implemented as Active := True and Stop as Active := False, so the two entry points are interchangeable and always consistent with each other. Both are idempotent: starting an already started server or stopping an already stopped one does nothing.
This member is available in the Delphi/C++Builder implementation only. The .NET implementation tracks the listener state internally and exposes no Active property, so use Start() and Stop() in cross-language code.
oServer := TsgcQUICServer.Create(nil);
oServer.Port := 4433;
oServer.QUICOptions.SSLOptions.CertFile := 'cert.pem';
oServer.QUICOptions.SSLOptions.KeyFile := 'key.pem';
try
oServer.Start; // same as oServer.Active := True
except
on E: Exception do
Log('start failed: ' + E.Message);
end;
// Active reports the real QUIC listener state
if oServer.Active then
Log('QUIC server listening on UDP port ' + IntToStr(oServer.Port));
// stopping through the property, same as oServer.Stop
oServer.Active := False;