20#include <xrpld/peerfinder/PeerfinderManager.h>
21#include <xrpld/peerfinder/detail/SlotImp.h>
22#include <xrpld/peerfinder/detail/Tuning.h>
37 , m_remote_endpoint(remote_endpoint)
38 , m_local_endpoint(local_endpoint)
39 , m_listening_port(unknownPort)
42 , connectivityCheckInProgress(false)
55 , m_remote_endpoint(remote_endpoint)
56 , m_listening_port(unknownPort)
59 , connectivityCheckInProgress(false)
69 "ripple::PeerFinder::SlotImp::state : input state is not active");
74 "ripple::PeerFinder::SlotImp::state : input state is different from "
80 "ripple::PeerFinder::SlotImp::state : input state is not an initial");
85 "ripple::PeerFinder::SlotImp::state : input state is not connected an "
91 "ripple::PeerFinder::SlotImp::state : input state is not closing an "
103 "ripple::PeerFinder::SlotImp::activate : valid state");
122 auto const result(cache.emplace(ep, hops));
126 if (hops <= result.first->second)
128 result.first->second = hops;
129 cache.touch(result.first);
137 auto const iter(cache.find(ep));
138 if (iter == cache.end())
143 return iter->second <= hops;
A version-independent IP address and port combination.
typename Clock::time_point time_point
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.
void insert(beast::IP::Endpoint const &ep, std::uint32_t hops)
Called for each valid endpoint received for a slot.
void activate(clock_type::time_point const &now)
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
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.