rippled
Loading...
Searching...
No Matches
Fixed.h
1#ifndef XRPL_PEERFINDER_FIXED_H_INCLUDED
2#define XRPL_PEERFINDER_FIXED_H_INCLUDED
3
4#include <xrpld/peerfinder/detail/Tuning.h>
5
6namespace ripple {
7namespace PeerFinder {
8
10class Fixed
11{
12public:
13 explicit Fixed(clock_type& clock) : m_when(clock.now()), m_failures(0)
14 {
15 }
16
17 Fixed(Fixed const&) = default;
18
21 when() const
22 {
23 return m_when;
24 }
25
27 void
35
37 void
39 {
40 m_failures = 0;
41 m_when = now;
42 }
43
44private:
47};
48
49} // namespace PeerFinder
50} // namespace ripple
51
52#endif
Metadata for a Fixed slot.
Definition Fixed.h:11
clock_type::time_point const & when() const
Returns the time after which we shoud allow a connection attempt.
Definition Fixed.h:21
clock_type::time_point m_when
Definition Fixed.h:45
Fixed(Fixed const &)=default
void failure(clock_type::time_point const &now)
Updates metadata to reflect a failed connection.
Definition Fixed.h:28
void success(clock_type::time_point const &now)
Updates metadata to reflect a successful connection.
Definition Fixed.h:38
std::size_t m_failures
Definition Fixed.h:46
Fixed(clock_type &clock)
Definition Fixed.h:13
T min(T... args)
static std::array< int, 10 > const connectionBackoff
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6