ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Attributes | List of all members
retry_options Struct Referencefinal

Configuration for client retry and reconnection behavior. More...

#include <client_options.hpp>

Collaboration diagram for retry_options:
Collaboration graph

Public Attributes

std::uint32_t max_attempts {5}
 Maximum number of connection attempts before giving up.
 
std::chrono::milliseconds base_delay {10 * 100}
 Base delay for exponential backoff.
 
std::chrono::milliseconds max_delay {60 * 1000}
 Maximum delay between retry attempts.
 
double jitter_factor {0.2}
 Jitter factor for randomizing retry delays.
 
bool auto_reconnect {true}
 Whether to automatically reconnect after disconnect.
 

Detailed Description

Configuration for client retry and reconnection behavior.

Member Data Documentation

◆ max_attempts

std::uint32_t max_attempts {5}

Maximum number of connection attempts before giving up.

Set to 0 to disable retries (single attempt only).

◆ base_delay

std::chrono::milliseconds base_delay {10 * 100}

Base delay for exponential backoff.

The actual delay is calculated as: base_delay * 2^attempt

◆ max_delay

std::chrono::milliseconds max_delay {60 * 1000}

Maximum delay between retry attempts.

Caps the exponential backoff to prevent excessively long waits.

◆ jitter_factor

double jitter_factor {0.2}

Jitter factor for randomizing retry delays.

A value of 0.2 means ±20% random variation. This helps prevent thundering herd when multiple clients reconnect simultaneously.

◆ auto_reconnect

bool auto_reconnect {true}

Whether to automatically reconnect after disconnect.

When enabled, the client will attempt to reconnect using exponential backoff when the connection is lost (detected via heartbeat or read error).