ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
connection_attempt_context_t Struct Reference

Context for TCP connection attempts. More...

#include <src/client/connection_state.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.
 
acip_transport_t * active_transport
 Currently active transport.
 
struct tcp_client * tcp_client_instance
 TCP client instance - owned by context.
 
struct websocket_client * ws_client_instance
 WebSocket client instance - owned by context.
 
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 TCP connection attempts.

Manages TCP connection state including:

  • State machine tracking (current state, previous state)
  • Timeout management
  • TCP transport and client instance
  • Statistics (retry count, transitions)

Created at client startup, persists across reconnection attempts.

Definition at line 78 of file connection_state.h.

Field Documentation

◆ active_transport

acip_transport_t* connection_attempt_context_t::active_transport

Currently active transport.

Definition at line 88 of file connection_state.h.

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

◆ attempt_start_time_ns

uint64_t connection_attempt_context_t::attempt_start_time_ns

When current attempt began.

Definition at line 84 of file connection_state.h.

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

◆ current_state

connection_state_t connection_attempt_context_t::current_state

Current connection state.

Definition at line 80 of file connection_state.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 97 of file connection_state.h.

◆ previous_state

connection_state_t connection_attempt_context_t::previous_state

Previous state (for debugging)

Definition at line 81 of file connection_state.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 93 of file connection_state.h.

Referenced by connection_attempt_tcp(), and connection_context_init().

◆ tcp_client_instance

struct tcp_client* connection_attempt_context_t::tcp_client_instance

TCP client instance - owned by context.

Definition at line 89 of file connection_state.h.

Referenced by connection_attempt_tcp(), and connection_context_cleanup().

◆ timeout_ns

uint64_t connection_attempt_context_t::timeout_ns

Timeout for connection attempt.

Definition at line 85 of file connection_state.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 94 of file connection_state.h.

Referenced by connection_context_init(), and connection_state_transition().

◆ ws_client_instance

struct websocket_client* connection_attempt_context_t::ws_client_instance

WebSocket client instance - owned by context.

Definition at line 90 of file connection_state.h.

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


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