3#include <xrpl/beast/net/IPEndpoint.h>
4#include <xrpl/beast/utility/PropertyStream.h>
5#include <xrpl/peerfinder/Config.h>
6#include <xrpl/peerfinder/Slot.h>
7#include <xrpl/peerfinder/Types.h>
8#include <xrpl/protocol/PublicKey.h>
10#include <boost/asio/ip/tcp.hpp>
134 boost::asio::ip::tcp::endpoint
const& remoteAddress,
Subclasses can be called to write to a stream and have children.
std::string const & name() const
Returns the name of this source.
A version-independent IP address and port combination.
virtual void onEndpoints(std::shared_ptr< Slot > const &slot, Endpoints const &endpoints)=0
Called when mtENDPOINTS is received.
virtual std::pair< std::shared_ptr< Slot >, Result > newInboundSlot(beast::ip::Endpoint const &localEndpoint, beast::ip::Endpoint const &remoteEndpoint)=0
Add a URL as a fallback location to obtain ip::Endpoint sources.
virtual void onRedirects(boost::asio::ip::tcp::endpoint const &remoteAddress, std::vector< boost::asio::ip::tcp::endpoint > const &eps)=0
Called when we received redirect IPs from a busy peer.
virtual void oncePerSecond()=0
Perform periodic activity.
virtual void setConfig(Config const &config)=0
Set the configuration for the manager.
virtual std::vector< beast::ip::Endpoint > autoconnect()=0
Return a set of addresses we should connect to.
virtual std::vector< Endpoint > redirect(std::shared_ptr< Slot > const &slot)=0
Returns a set of endpoints suitable for redirection.
virtual Result activate(std::shared_ptr< Slot > const &slot, PublicKey const &key, bool reserved)=0
Request an active slot type.
virtual Config config()=0
Returns the configuration for the manager.
virtual std::pair< std::shared_ptr< Slot >, Result > newOutboundSlot(beast::ip::Endpoint const &remoteEndpoint)=0
Create a new outbound slot with the specified remote endpoint.
virtual bool onConnected(std::shared_ptr< Slot > const &slot, beast::ip::Endpoint const &localEndpoint)=0
Called when an outbound connection attempt succeeds.
virtual std::vector< std::pair< std::shared_ptr< Slot >, std::vector< Endpoint > > > buildEndpointsForPeers()=0
~Manager() override=default
Destroy the object.
virtual void stop()=0
Transition to the stopped state, synchronously.
virtual void onFailure(std::shared_ptr< Slot > const &slot)=0
Called when an outbound connection is deemed to have failed.
virtual void addFixedPeer(std::string_view name, std::vector< beast::ip::Endpoint > const &addresses)=0
Add a peer that should always be connected.
virtual void start()=0
Transition to the started state, synchronously.
virtual void onClosed(std::shared_ptr< Slot > const &slot)=0
Called when the slot is closed.
virtual void addFallbackStrings(std::string const &name, std::vector< std::string > const &strings)=0
Add a set of strings as fallback ip::Endpoint sources.
Result
Possible results from activating a slot.
std::vector< Endpoint > Endpoints
A set of Endpoint used for connecting.
PeerFinder configuration settings.