- Documentation
Torch Log Service
SDK reference
C++ SDK
Configure timeout and retry policies
C++ SDK
Configure timeout and retry policies
Configure timeout and retry policies
This topic describes how to configure the client to adjust the timeout period and retry policy.
Setting the request timeout period
In client configurations, set the timeout period of a request in milliseconds. If the specified period is reached but the server does not respond, the SDK returns an empty response.
The following sample code sets the request timeout period to 100 milliseconds.
cfg.endpoint = "Your endpoint";
cfg.access_key_id = "Your access key";
cfg.access_key_secret = "Your access key secret";
cfg.region = "Your region";
cfg.timeout_millisecond = 100;
TlsClient client = TlsClient(cfg);
Configuring the SDK retry policy
Torch Log Service (TLS) SDK for C++ has a built-in retry mechanism for HTTP error codes such as 429 and 500, and the mechanism is enabled by default. To disable the retry mechanism, set cfg.disable_retry to true.
cfg.endpoint = "Your endpoint";
cfg.access_key_id = "Your access key";
cfg.access_key_secret = "Your access key secret";
cfg.region = "Your region";
cfg.disable_retry = true;
TlsClient client = TlsClient(cfg);
Last updated: 2025.10.11 16:44:07