TsgcHTTP2Client › Properties › Throttle
Limits the number of bits per second sent or received by the HTTP/2 socket.
property Throttle: TsgcTCPThrottle read GetThrottle write SetThrottle;
Enabled=False
Use Throttle to cap the outgoing and incoming bandwidth of the HTTP/2 client. Enable the feature and set the desired bits-per-second; the transport layer pauses read/write operations to stay within the limit. Useful to simulate slow networks when testing HTTP/2 streaming or large downloads, and to share upstream bandwidth between several HTTP/2 clients running in the same process.
oHTTP2 := TsgcHTTP2Client.Create(nil);
oHTTP2.Host := 'http2.akamai.com';
oHTTP2.Port := 443;
oHTTP2.TLS := True;
oHTTP2.Throttle.Enabled := True;
oHTTP2.Throttle.BitsPerSec := 256 * 1024;