Back to Site
Loading...
Searching...
No Matches
librats::ReconnectionService Class Referencefinal

#include <reconnection.h>

Inheritance diagram for librats::ReconnectionService:
[legend]
Collaboration diagram for librats::ReconnectionService:
[legend]

Classes

struct  Config
 

Public Member Functions

 ReconnectionService ()
 
 ReconnectionService (Config config)
 
 ~ReconnectionService () override
 
void add (const Address &address)
 Register an address to keep connected. Persists it if a store is configured.
 
void remove (const Address &address)
 Stop reconnecting to an address: drops it as a target and from the store.
 
size_t target_count () const
 
std::vector< Addressknown_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.
 
void attach (NodeContext &ctx) override
 
void start () override
 
void stop () override
 
- Public Member Functions inherited from librats::Subsystem
virtual ~Subsystem ()=default
 

Detailed Description

Definition at line 41 of file reconnection.h.

Constructor & Destructor Documentation

◆ ReconnectionService() [1/2]

librats::ReconnectionService::ReconnectionService ( )

◆ ReconnectionService() [2/2]

librats::ReconnectionService::ReconnectionService ( Config  config)
explicit

◆ ~ReconnectionService()

librats::ReconnectionService::~ReconnectionService ( )
override

Member Function Documentation

◆ 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

Implements librats::Subsystem.

◆ 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.

◆ 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

Implements librats::Subsystem.

◆ stop()

void librats::ReconnectionService::stop ( )
overridevirtual

Implements librats::Subsystem.

◆ target_count()

size_t librats::ReconnectionService::target_count ( ) const

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