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

#include <ping_service.h>

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

Public Member Functions

 PingService (std::chrono::milliseconds interval=std::chrono::seconds(10))
 
 ~PingService () override
 
void attach (NodeContext &ctx) override
 
void start () override
 
void stop () override
 
std::optional< std::chrono::milliseconds > last_rtt (const PeerId &id) const
 Most recent measured round-trip time to a peer, if one has been seen.
 
size_t alive_peer_count () const
 Number of peers we have received at least one pong from.
 
- Public Member Functions inherited from librats::Subsystem
virtual ~Subsystem ()=default
 

Detailed Description

Definition at line 33 of file ping_service.h.

Constructor & Destructor Documentation

◆ PingService()

librats::PingService::PingService ( std::chrono::milliseconds  interval = std::chrono::seconds(10))
explicit

◆ ~PingService()

librats::PingService::~PingService ( )
override

Member Function Documentation

◆ alive_peer_count()

size_t librats::PingService::alive_peer_count ( ) const

Number of peers we have received at least one pong from.

◆ attach()

void librats::PingService::attach ( NodeContext ctx)
overridevirtual

Implements librats::Subsystem.

◆ last_rtt()

std::optional< std::chrono::milliseconds > librats::PingService::last_rtt ( const PeerId id) const

Most recent measured round-trip time to a peer, if one has been seen.

◆ start()

void librats::PingService::start ( )
overridevirtual

Implements librats::Subsystem.

◆ stop()

void librats::PingService::stop ( )
overridevirtual

Implements librats::Subsystem.


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