rippled
Public Types | Public Member Functions | List of all members
ripple::PeerFinder::Slot Class Referenceabstract

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

Inheritance diagram for ripple::PeerFinder::Slot:
Inheritance graph
[legend]

Public Types

enum  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. More...
 
virtual bool fixed () const =0
 Returns true if this is a fixed connection. More...
 
virtual bool reserved () const =0
 Returns true if this is a reserved connection. More...
 
virtual State state () const =0
 Returns the state of the connection. More...
 
virtual beast::IP::Endpoint const & remote_endpoint () const =0
 The remote endpoint of socket. More...
 
virtual std::optional< beast::IP::Endpoint > const & local_endpoint () const =0
 The local endpoint of the socket, when known. More...
 
virtual std::optional< std::uint16_tlistening_port () const =0
 
virtual std::optional< PublicKey > const & public_key () const =0
 The peer's public key, when known. More...
 

Detailed Description

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

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

Member Typedef Documentation

◆ ptr

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

Member Enumeration Documentation

◆ State

Enumerator
accept 
connect 
connected 
active 
closing 

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

Constructor & Destructor Documentation

◆ ~Slot()

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

Member Function Documentation

◆ inbound()

virtual bool ripple::PeerFinder::Slot::inbound ( ) const
pure virtual

Returns true if this is an inbound connection.

Implemented in ripple::PeerFinder::SlotImp.

◆ fixed()

virtual bool ripple::PeerFinder::Slot::fixed ( ) const
pure 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 ripple::PeerFinder::SlotImp.

◆ reserved()

virtual bool ripple::PeerFinder::Slot::reserved ( ) const
pure 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 ripple::PeerFinder::SlotImp.

◆ state()

virtual State ripple::PeerFinder::Slot::state ( ) const
pure virtual

Returns the state of the connection.

Implemented in ripple::PeerFinder::SlotImp.

◆ remote_endpoint()

virtual beast::IP::Endpoint const& ripple::PeerFinder::Slot::remote_endpoint ( ) const
pure virtual

The remote endpoint of socket.

Implemented in ripple::PeerFinder::SlotImp.

◆ local_endpoint()

virtual std::optional<beast::IP::Endpoint> const& ripple::PeerFinder::Slot::local_endpoint ( ) const
pure virtual

The local endpoint of the socket, when known.

Implemented in ripple::PeerFinder::SlotImp.

◆ listening_port()

virtual std::optional<std::uint16_t> ripple::PeerFinder::Slot::listening_port ( ) const
pure virtual

Implemented in ripple::PeerFinder::SlotImp.

◆ public_key()

virtual std::optional<PublicKey> const& ripple::PeerFinder::Slot::public_key ( ) const
pure virtual

The peer's public key, when known.

The public key is established when the handshake is complete.

Implemented in ripple::PeerFinder::SlotImp.