xrpld
Loading...
Searching...
No Matches
peerfinder/Slot.h
1#pragma once
2
3#include <xrpl/beast/net/IPEndpoint.h>
4#include <xrpl/protocol/PublicKey.h>
5
6#include <optional>
7
8namespace xrpl::PeerFinder {
9
11class Slot
12{
13public:
15
17
18 virtual ~Slot() = 0;
19
21 [[nodiscard]] virtual bool
22 inbound() const = 0;
23
28 [[nodiscard]] virtual bool
29 fixed() const = 0;
30
35 [[nodiscard]] virtual bool
36 reserved() const = 0;
37
39 [[nodiscard]] virtual State
40 state() const = 0;
41
43 [[nodiscard]] virtual beast::IP::Endpoint const&
44 remoteEndpoint() const = 0;
45
47 [[nodiscard]] virtual std::optional<beast::IP::Endpoint> const&
48 localEndpoint() const = 0;
49
50 [[nodiscard]] virtual std::optional<std::uint16_t>
51 listeningPort() const = 0;
52
56 [[nodiscard]] virtual std::optional<PublicKey> const&
57 publicKey() const = 0;
58};
59
60} // namespace xrpl::PeerFinder
A version-independent IP address and port combination.
Definition IPEndpoint.h:17
Properties and state associated with a peer to peer overlay connection.
std::shared_ptr< Slot > ptr
virtual beast::IP::Endpoint const & remoteEndpoint() const =0
The remote endpoint of socket.
virtual bool reserved() const =0
Returns true if this is a reserved connection.
virtual std::optional< beast::IP::Endpoint > const & localEndpoint() const =0
The local endpoint of the socket, when known.
virtual State state() const =0
Returns the state of the connection.
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 std::optional< PublicKey > const & publicKey() const =0
The peer's public key, when known.
virtual std::optional< std::uint16_t > listeningPort() const =0