Back to Site
Loading...
Searching...
No Matches
librats::DhtNode Struct Reference

DHT Node information Based on libtorrent's node_entry with fail_count and RTT tracking. More...

#include <dht.h>

Collaboration diagram for librats::DhtNode:
[legend]

Public Member Functions

 DhtNode ()
 
 DhtNode (const NodeId &id, const Peer &peer)
 
bool pinged () const
 
bool confirmed () const
 
void mark_failed ()
 
void mark_success ()
 
void update_rtt (uint16_t new_rtt)
 
bool is_worse_than (const DhtNode &other) const
 

Public Attributes

NodeId id
 
Peer peer
 
std::chrono::steady_clock::time_point last_seen
 
uint16_t rtt = 0xffff
 
uint8_t fail_count = 0xff
 

Detailed Description

DHT Node information Based on libtorrent's node_entry with fail_count and RTT tracking.

Definition at line 68 of file dht.h.

Constructor & Destructor Documentation

◆ DhtNode() [1/2]

librats::DhtNode::DhtNode ( )
inline

Definition at line 79 of file dht.h.

◆ DhtNode() [2/2]

librats::DhtNode::DhtNode ( const NodeId id,
const Peer peer 
)
inline

Definition at line 80 of file dht.h.

Member Function Documentation

◆ confirmed()

bool librats::DhtNode::confirmed ( ) const
inline

Definition at line 87 of file dht.h.

References fail_count.

◆ is_worse_than()

bool librats::DhtNode::is_worse_than ( const DhtNode other) const
inline

Definition at line 113 of file dht.h.

References fail_count, and rtt.

◆ mark_failed()

void librats::DhtNode::mark_failed ( )
inline

Definition at line 90 of file dht.h.

References fail_count, and pinged().

◆ mark_success()

void librats::DhtNode::mark_success ( )
inline

Definition at line 95 of file dht.h.

References fail_count, and last_seen.

◆ pinged()

bool librats::DhtNode::pinged ( ) const
inline

Definition at line 84 of file dht.h.

References fail_count.

Referenced by mark_failed().

◆ update_rtt()

void librats::DhtNode::update_rtt ( uint16_t  new_rtt)
inline

Definition at line 101 of file dht.h.

References rtt.

Member Data Documentation

◆ fail_count

uint8_t librats::DhtNode::fail_count = 0xff

Definition at line 77 of file dht.h.

Referenced by confirmed(), is_worse_than(), mark_failed(), mark_success(), and pinged().

◆ id

NodeId librats::DhtNode::id

Definition at line 69 of file dht.h.

◆ last_seen

std::chrono::steady_clock::time_point librats::DhtNode::last_seen

Definition at line 71 of file dht.h.

Referenced by mark_success().

◆ peer

Peer librats::DhtNode::peer

Definition at line 70 of file dht.h.

◆ rtt

uint16_t librats::DhtNode::rtt = 0xffff

Definition at line 74 of file dht.h.

Referenced by is_worse_than(), and update_rtt().


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