unilink  0.4.3
A simple C++ library for unified async communication
unilink::transport::detail Namespace Reference

Classes

struct  ReconnectLogicDecision
 Represents the decision on whether to retry a connection attempt. More...
 

Functions

std::chrono::milliseconds clamp_reconnect_delay (std::chrono::milliseconds 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. More...
 

Variables

constexpr auto MAX_RECONNECT_DELAY = std::chrono::milliseconds(30000)
 

Function Documentation

◆ clamp_reconnect_delay()

std::chrono::milliseconds unilink::transport::detail::clamp_reconnect_delay ( std::chrono::milliseconds  delay)
inline

Definition at line 43 of file reconnect_decider.hpp.

◆ decide_reconnect()

ReconnectLogicDecision unilink::transport::detail::decide_reconnect ( const config::TcpClientConfig cfg,
const diagnostics::ErrorInfo error_info,
uint32_t  attempt_count,
const std::optional< ReconnectPolicy > &  policy 
)
inline

Determines whether a reconnection attempt should be made and the base delay to use.

Guard ordering is intentional: 1) non-retryable errors stop immediately 2) max_retries limits stop immediately 3) custom policy is consulted only after guards pass 4) no policy falls back to cfg.retry_interval_ms

Definition at line 59 of file reconnect_decider.hpp.

Variable Documentation

◆ MAX_RECONNECT_DELAY

constexpr auto unilink::transport::detail::MAX_RECONNECT_DELAY = std::chrono::milliseconds(30000)
constexpr

Definition at line 33 of file reconnect_decider.hpp.