Back to Site
Loading...
Searching...
No Matches
librats::DhtDiscovery::Redials Class Reference

Which addresses found to dial, and how: a policy of times alone. More...

#include <dht_discovery.h>

Public Types

enum class  Dial : uint8_t { None , First , Again }
using Clock = std::chrono::steady_clock

Public Member Functions

 Redials (std::chrono::milliseconds every, std::chrono::milliseconds dial_for, std::chrono::milliseconds slow)
 Punched every every for dial_for after first found (due()); then, as found again, every slow at most (found()).
Dial found (const Address &address, Clock::time_point now)
 address found at now, not connected.
std::vector< Address > due (Clock::time_point now)
 The addresses whose punch is due at now in their first stretch (dial_for after first found), found again or not — each marked punched.
std::optional< Clock::time_point > next_due () const
 When the next of those is due; none: none is in its first stretch.
void connected (const Address &address)
 address found connected: once its link is gone, it is dialed as though found for the first time.
void forget_older_than (Clock::time_point before)
 Forget what has not been found for a while: the DHT stops handing out an address half an hour after its last announce.
size_t size () const

Detailed Description

Which addresses found to dial, and how: a policy of times alone.

Definition at line 130 of file dht_discovery.h.

Member Typedef Documentation

◆ Clock

using librats::DhtDiscovery::Redials::Clock = std::chrono::steady_clock

Definition at line 137 of file dht_discovery.h.

Member Enumeration Documentation

◆ Dial

enum class librats::DhtDiscovery::Redials::Dial : uint8_t
strong
Enumerator
None 

dialed lately

First 

never dialed: the ordinary dial

Again 

not reached yet: a punch

Definition at line 132 of file dht_discovery.h.

Constructor & Destructor Documentation

◆ Redials()

librats::DhtDiscovery::Redials::Redials ( std::chrono::milliseconds every,
std::chrono::milliseconds dial_for,
std::chrono::milliseconds slow )
inline

Punched every every for dial_for after first found (due()); then, as found again, every slow at most (found()).

Definition at line 141 of file dht_discovery.h.

Member Function Documentation

◆ connected()

void librats::DhtDiscovery::Redials::connected ( const Address & address)
inline

address found connected: once its link is gone, it is dialed as though found for the first time.

Definition at line 155 of file dht_discovery.h.

◆ due()

std::vector< Address > librats::DhtDiscovery::Redials::due ( Clock::time_point now)

The addresses whose punch is due at now in their first stretch (dial_for after first found), found again or not — each marked punched.

◆ forget_older_than()

void librats::DhtDiscovery::Redials::forget_older_than ( Clock::time_point before)

Forget what has not been found for a while: the DHT stops handing out an address half an hour after its last announce.

◆ found()

Dial librats::DhtDiscovery::Redials::found ( const Address & address,
Clock::time_point now )

address found at now, not connected.

◆ next_due()

std::optional< Clock::time_point > librats::DhtDiscovery::Redials::next_due ( ) const

When the next of those is due; none: none is in its first stretch.

◆ size()

size_t librats::DhtDiscovery::Redials::size ( ) const
inline

Definition at line 159 of file dht_discovery.h.


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