ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
connection_attempt_context_t Struct Reference

Context for connection attempts (TCP or WebSocket) More...

#include <include/ascii-chat/network/connection_attempt.h>

Data Fields

connection_state_t current_state
 Current connection state.
 
connection_state_t previous_state
 Previous state (for debugging)
 
uint64_t attempt_start_time_ns
 When current attempt began.
 
uint64_t timeout_ns
 Timeout for connection attempt.
 
connection_handle_t connection
 Shared transport/client ownership handle.
 
uint32_t reconnect_attempt
 Reconnection attempt number (1st, 2nd, etc.)
 
uint32_t total_transitions
 Total state transitions (for metrics)
 
bool is_reconnection
 True if reconnecting after successful connection (not first connect)
 

Detailed Description

Context for connection attempts (TCP or WebSocket)

Manages connection state including:

  • State machine tracking (current state, previous state)
  • Timeout management
  • Transport instance (TCP or WebSocket)
  • Statistics (retry count, transitions)

Created at client startup, persists across reconnection attempts.

Definition at line 82 of file connection_attempt.h.

Field Documentation

◆ attempt_start_time_ns

uint64_t connection_attempt_context_t::attempt_start_time_ns

When current attempt began.

Definition at line 88 of file connection_attempt.h.

Referenced by connection_attempt_tcp(), connection_attempt_websocket(), connection_check_timeout(), and connection_context_init().

◆ connection

connection_handle_t connection_attempt_context_t::connection

Shared transport/client ownership handle.

Definition at line 92 of file connection_attempt.h.

Referenced by connection_attempt_tcp(), connection_attempt_websocket(), connection_context_cleanup(), and connection_context_init().

◆ current_state

connection_state_t connection_attempt_context_t::current_state

Current connection state.

Definition at line 84 of file connection_attempt.h.

Referenced by connection_context_init(), and connection_state_transition().

◆ is_reconnection

bool connection_attempt_context_t::is_reconnection

True if reconnecting after successful connection (not first connect)

Definition at line 99 of file connection_attempt.h.

◆ previous_state

connection_state_t connection_attempt_context_t::previous_state

Previous state (for debugging)

Definition at line 85 of file connection_attempt.h.

Referenced by connection_context_init(), and connection_state_transition().

◆ reconnect_attempt

uint32_t connection_attempt_context_t::reconnect_attempt

Reconnection attempt number (1st, 2nd, etc.)

Definition at line 95 of file connection_attempt.h.

Referenced by connection_attempt_tcp(), and connection_context_init().

◆ timeout_ns

uint64_t connection_attempt_context_t::timeout_ns

Timeout for connection attempt.

Definition at line 89 of file connection_attempt.h.

Referenced by connection_attempt_tcp(), connection_attempt_websocket(), connection_check_timeout(), and connection_context_init().

◆ total_transitions

uint32_t connection_attempt_context_t::total_transitions

Total state transitions (for metrics)

Definition at line 96 of file connection_attempt.h.

Referenced by connection_context_init(), and connection_state_transition().


The documentation for this struct was generated from the following file: