1#include <xrpld/peerfinder/PeerfinderManager.h>
2#include <xrpld/peerfinder/detail/SlotImp.h>
3#include <xrpld/peerfinder/detail/Tuning.h>
18 , m_remote_endpoint(remote_endpoint)
19 , m_local_endpoint(local_endpoint)
20 , m_listening_port(unknownPort)
23 , connectivityCheckInProgress(false)
33 , m_remote_endpoint(remote_endpoint)
34 , m_listening_port(unknownPort)
37 , connectivityCheckInProgress(false)
45 XRPL_ASSERT(state_ !=
active,
"xrpl::PeerFinder::SlotImp::state : input state is not active");
50 "xrpl::PeerFinder::SlotImp::state : input state is different from "
55 state_ !=
accept && state_ !=
connect,
"xrpl::PeerFinder::SlotImp::state : input state is not an initial");
60 "xrpl::PeerFinder::SlotImp::state : input state is not connected an "
66 "xrpl::PeerFinder::SlotImp::state : input state is not closing an "
95 auto const result(cache.emplace(ep, hops));
99 if (hops <= result.first->second)
101 result.first->second = hops;
102 cache.touch(result.first);
110 auto const iter(cache.find(ep));
111 if (iter == cache.end())
116 return iter->second <= hops;
A version-independent IP address and port combination.
typename Clock::time_point time_point
void insert(beast::IP::Endpoint const &ep, std::uint32_t hops)
Called for each valid endpoint received for a slot.
recent_t(clock_type &clock)
bool filter(beast::IP::Endpoint const &ep, std::uint32_t hops)
Returns true if we should not send endpoint to the slot.
SlotImp(beast::IP::Endpoint const &local_endpoint, beast::IP::Endpoint const &remote_endpoint, bool fixed, clock_type &clock)
State state() const override
Returns the state of the connection.
clock_type::time_point whenAcceptEndpoints
void activate(clock_type::time_point const &now)
std::enable_if< is_aged_container< AgedContainer >::value, std::size_t >::type expire(AgedContainer &c, std::chrono::duration< Rep, Period > const &age)
Expire aged container items past the specified age.
std::chrono::seconds constexpr liveCacheSecondsToLive(30)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
static FunctionType fixed(Keylet const &keylet)