TsgcHTTP2ClientProperties › ConnectTimeout

ConnectTimeout Property

Maximum time in milliseconds the client waits for the TCP/TLS connection and HTTP/2 preface to complete.

Syntax

property ConnectTimeout: Integer read FConnectTimeout write FConnectTimeout;

Default Value

0

Remarks

A value of 0 means use the underlying socket's default behaviour (no explicit timeout). When a positive value is set, the client aborts the connection attempt if the TCP handshake, TLS negotiation (including ALPN) and HTTP/2 preface are not completed within the specified number of milliseconds and raises an error. ConnectTimeout only applies to the connection establishment; subsequent request operations use ReadTimeout.

Example


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

Back to Properties