40 std::optional<std::chrono::milliseconds>
delay{std::nullopt};
44 if (delay < std::chrono::milliseconds(0)) {
45 return std::chrono::milliseconds(0);
61 const std::optional<ReconnectPolicy>& policy) {
63 return {
false, std::nullopt};
67 return {
false, std::nullopt};
71 return {
false, std::nullopt};
75 auto policy_decision = (*policy)(error_info, attempt_count);
76 if (!policy_decision.retry) {
77 return {
false, std::nullopt};
std::chrono::milliseconds clamp_reconnect_delay(std::chrono::milliseconds delay)
constexpr auto MAX_RECONNECT_DELAY
ReconnectLogicDecision decide_reconnect(const config::TcpClientConfig &cfg, const diagnostics::ErrorInfo &error_info, uint32_t attempt_count, const std::optional< ReconnectPolicy > &policy)
Determines whether a reconnection attempt should be made and the base delay to use.
unsigned retry_interval_ms
Comprehensive error information structure.
Represents the decision on whether to retry a connection attempt.
std::optional< std::chrono::milliseconds > delay