#include <reconnection.h>
|
| static bool | lost (CloseReason reason) noexcept |
| | Whether a connection that closed for reason was lost rather than ended: neither side closed it — the peer went quiet past the idle deadline or stopped answering.
|
Definition at line 53 of file reconnection.h.
◆ ReconnectionService() [1/2]
| librats::ReconnectionService::ReconnectionService |
( |
| ) |
|
◆ ReconnectionService() [2/2]
| librats::ReconnectionService::ReconnectionService |
( |
Config | config | ) |
|
|
explicit |
◆ ~ReconnectionService()
| librats::ReconnectionService::~ReconnectionService |
( |
| ) |
|
|
override |
◆ add()
| void librats::ReconnectionService::add |
( |
const Address & | address | ) |
|
Register an address to keep connected. Persists it if a store is configured.
◆ attach()
| void librats::ReconnectionService::attach |
( |
NodeContext & | ctx | ) |
|
|
overridevirtual |
◆ known_peers()
| std::vector< Address > librats::ReconnectionService::known_peers |
( |
size_t | n | ) |
const |
The passive reserve pool: up to n best-known peer addresses from the book (history of everyone we have connected to), most promising first.
Not dialed automatically beyond the startup seed — exposed for the app / discovery to use as a bootstrap source when peer count is low.
◆ lost()
| bool librats::ReconnectionService::lost |
( |
CloseReason | reason | ) |
|
|
inlinestaticnoexcept |
Whether a connection that closed for reason was lost rather than ended: neither side closed it — the peer went quiet past the idle deadline or stopped answering.
Definition at line 73 of file reconnection.h.
Referenced by stop().
◆ lost_peers()
| std::vector< PeerId > librats::ReconnectionService::lost_peers |
( |
| ) |
const |
The peers lost and being dialed again (Config::lost_for), until each is back or given up on.
◆ on_given_up()
| void librats::ReconnectionService::on_given_up |
( |
std::function< void(const PeerId &)> | handler | ) |
|
◆ remove()
| void librats::ReconnectionService::remove |
( |
const Address & | address | ) |
|
Stop reconnecting to an address: drops it as a target and from the store.
Use when the application intentionally parts with a peer and does not want it re-dialed. (A later fresh connection to it may re-learn it if persist_discovered is on.)
◆ start()
| void librats::ReconnectionService::start |
( |
| ) |
|
|
overridevirtual |
◆ stop()
| void librats::ReconnectionService::stop |
( |
| ) |
|
|
overridevirtual |
◆ target_count()
| size_t librats::ReconnectionService::target_count |
( |
| ) |
const |
The documentation for this class was generated from the following file: