Configurable retry policy with multiple backoff strategies. More...
| Header: | #include <WebRetryPolicy> |
| int | calculateDelay(int attemptNumber) const |
| bool | isRetryable(QNetworkReply::NetworkError error) const |
| int | maxRetries() const |
| void | setRetryOnConnectionRefused(bool retry) |
| void | setRetryOnDnsFailure(bool retry) |
| void | setRetryOnTimeout(bool retry) |
| bool | shouldRetry(int currentAttempt) const |
WebRetryPolicy defines how QWebDownload retries failed requests. It supports four backoff strategies (Linear, Exponential, Fibonacci, Fixed) and provides factory methods for common use cases.
// Critical downloads: 5 retries, fibonacci backoff config.retryPolicy = WebRetryPolicy::forCritical(); // Feed updates: 3 retries, exponential backoff config.retryPolicy = WebRetryPolicy::forFeedUpdate(); // Non-critical: 2 retries, linear backoff config.retryPolicy = WebRetryPolicy::forFavicon(); // No retries at all config.retryPolicy = WebRetryPolicy::noRetry();
See also QWebDownload and WebDownloadConfig.
Returns retry delay.
Whether or not we should try, try again.
Returns max retries.
Sets if we will retry on connection refused.
Sets if we will retry on DNS errors.
Sets if we will retry on timeout errors.
Check if retries should continue or give up.