TsgcHTTP2Client › Properties › NotifyEvents
控制 HTTP/2 事件如何调度到主线程。
property NotifyEvents: TwsNotifyEvent read FNotifyEvents write SetNotifyEvents;
neAsynchronous
有三种模式可用:neAsynchronous(默认)、neSynchronous 和 neNoSync。neNoSync 直接在连接线程上触发事件,速度更快,但要求事件处理程序代码是线程安全的。
oHTTP2 := TsgcHTTP2Client.Create(nil);
oHTTP2.Host := 'http2.akamai.com';
oHTTP2.Port := 443;
oHTTP2.TLS := True;
oHTTP2.NotifyEvents := neSynchronous;