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

Ring consensus state (Host-Mediated Proactive Election) More...

#include <src/discovery/session.h>

Data Fields

uint8_t future_host_id [16]
 Who will host if current host dies.
 
char future_host_address [64]
 Where to connect.
 
uint16_t future_host_port
 Port number.
 
uint8_t future_host_connection_type
 acip_connection_type_t (DIRECT, UPNP, STUN, TURN)
 
bool am_future_host
 Am I the elected future host?
 
uint64_t future_host_elected_round
 Which 5-minute round this was elected in.
 
uint64_t last_ring_round_ms
 When host last ran election (for 5-min timer)
 

Detailed Description

Ring consensus state (Host-Mediated Proactive Election)

NEW SIMPLIFIED DESIGN:

  • Host (not quorum leader) collects NETWORK_QUALITY from all participants every 5 minutes
  • Participants send metrics TO HOST (not peer-to-peer)
  • Host elects future host and broadcasts FUTURE_HOST_ELECTED
  • All participants store future host info locally
  • When current host dies: instant failover to pre-elected host (no re-election!)

Participants just need to store the pre-elected future host info. No ring topology, no quorum leader rotation, no P2P collection.

Definition at line 49 of file session.h.

Field Documentation

◆ am_future_host

bool ring_consensus_t::am_future_host

Am I the elected future host?

Definition at line 55 of file session.h.

Referenced by discovery_session_handle_host_disconnect(), discovery_session_init_ring(), and discovery_session_is_future_host().

◆ future_host_address

char ring_consensus_t::future_host_address[64]

◆ future_host_connection_type

uint8_t ring_consensus_t::future_host_connection_type

acip_connection_type_t (DIRECT, UPNP, STUN, TURN)

Definition at line 54 of file session.h.

Referenced by discovery_session_connect_to_future_host(), and discovery_session_get_future_host().

◆ future_host_elected_round

uint64_t ring_consensus_t::future_host_elected_round

Which 5-minute round this was elected in.

Definition at line 56 of file session.h.

◆ future_host_id

uint8_t ring_consensus_t::future_host_id[16]

◆ future_host_port

uint16_t ring_consensus_t::future_host_port

◆ last_ring_round_ms

uint64_t ring_consensus_t::last_ring_round_ms

When host last ran election (for 5-min timer)

Definition at line 59 of file session.h.

Referenced by discovery_session_init_ring(), and discovery_session_start_ring_round().


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