xrpld
Loading...
Searching...
No Matches
xrpl::PeerFinder::Slot Class Referenceabstract

Properties and state associated with a peer to peer overlay connection. More...

#include <Slot.h>

Inheritance diagram for xrpl::PeerFinder::Slot:

Public Types

enum class  State {
  Accept , Connect , Connected , Active ,
  Closing
}
using ptr = std::shared_ptr<Slot>

Public Member Functions

virtual ~Slot ()=0
virtual bool inbound () const =0
 Returns true if this is an inbound connection.
virtual bool fixed () const =0
 Returns true if this is a fixed connection.
virtual bool reserved () const =0
 Returns true if this is a reserved connection.
virtual State state () const =0
 Returns the state of the connection.
virtual beast::IP::Endpoint const & remoteEndpoint () const =0
 The remote endpoint of socket.
virtual std::optional< beast::IP::Endpoint > const & localEndpoint () const =0
 The local endpoint of the socket, when known.
virtual std::optional< std::uint16_tlisteningPort () const =0
virtual std::optional< PublicKey > const & publicKey () const =0
 The peer's public key, when known.

Detailed Description

Properties and state associated with a peer to peer overlay connection.

Definition at line 11 of file peerfinder/Slot.h.

Member Typedef Documentation

◆ ptr

Member Enumeration Documentation

◆ State

enum class xrpl::PeerFinder::Slot::State
strong
Enumerator
Accept 
Connect 
Connected 
Active 
Closing 

Definition at line 16 of file peerfinder/Slot.h.

Constructor & Destructor Documentation

◆ ~Slot()

xrpl::PeerFinder::Slot::~Slot ( )
pure virtualdefault

Member Function Documentation

◆ inbound()

virtual bool xrpl::PeerFinder::Slot::inbound ( ) const
nodiscardpure virtual

Returns true if this is an inbound connection.

Implemented in xrpl::PeerFinder::SlotImp.

◆ fixed()

virtual bool xrpl::PeerFinder::Slot::fixed ( ) const
nodiscardpure virtual

Returns true if this is a fixed connection.

A connection is fixed if its remote endpoint is in the list of remote endpoints for fixed connections.

Implemented in xrpl::PeerFinder::SlotImp.

◆ reserved()

virtual bool xrpl::PeerFinder::Slot::reserved ( ) const
nodiscardpure virtual

Returns true if this is a reserved connection.

It might be a cluster peer, or a peer with a reservation. This is only known after then handshake completes.

Implemented in xrpl::PeerFinder::SlotImp.

◆ state()

virtual State xrpl::PeerFinder::Slot::state ( ) const
nodiscardpure virtual

Returns the state of the connection.

Implemented in xrpl::PeerFinder::SlotImp.

◆ remoteEndpoint()

virtual beast::IP::Endpoint const & xrpl::PeerFinder::Slot::remoteEndpoint ( ) const
nodiscardpure virtual

The remote endpoint of socket.

Implemented in xrpl::PeerFinder::SlotImp.

◆ localEndpoint()

virtual std::optional< beast::IP::Endpoint > const & xrpl::PeerFinder::Slot::localEndpoint ( ) const
nodiscardpure virtual

The local endpoint of the socket, when known.

Implemented in xrpl::PeerFinder::SlotImp.

◆ listeningPort()

virtual std::optional< std::uint16_t > xrpl::PeerFinder::Slot::listeningPort ( ) const
nodiscardpure virtual

Implemented in xrpl::PeerFinder::SlotImp.

◆ publicKey()

virtual std::optional< PublicKey > const & xrpl::PeerFinder::Slot::publicKey ( ) const
nodiscardpure virtual

The peer's public key, when known.

The public key is established when the handshake is complete.

Implemented in xrpl::PeerFinder::SlotImp.