TsgcHTTP2ClientProperties › NotifyEvents

NotifyEvents Property

Controls how HTTP/2 events are dispatched to the main thread.

Syntax

property NotifyEvents: TwsNotifyEvent read FNotifyEvents write SetNotifyEvents;

Default Value

neAsynchronous

Remarks

Three modes are available: neAsynchronous (default) queues HTTP/2 events and synchronises them with the main thread asynchronously; neSynchronous blocks the connection thread until the main thread has processed the event; neNoSync fires events directly on the connection thread, which is faster and better suited for console or service applications but requires the event handler code to be thread-safe.

Example


oHTTP2 := TsgcHTTP2Client.Create(nil);
oHTTP2.Host := 'http2.akamai.com';
oHTTP2.Port := 443;
oHTTP2.TLS := True;
oHTTP2.NotifyEvents := neSynchronous;

Back to Properties