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 |
Which addresses found to dial, and how: a policy of times alone.
Definition at line 130 of file dht_discovery.h.
| using librats::DhtDiscovery::Redials::Clock = std::chrono::steady_clock |
Definition at line 137 of file dht_discovery.h.
|
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.
|
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.
|
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.
| 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.
| 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.
address found at now, not connected.
| 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.
|
inline |
Definition at line 159 of file dht_discovery.h.