xrpld
Loading...
Searching...
No Matches
include/xrpl/peerfinder/Slot.h
1#pragma once
2
3#include <xrpl/beast/net/IPEndpoint.h>
4#include <xrpl/protocol/PublicKey.h>
5
6#include <cstdint>
7#include <memory>
8#include <optional>
9
10namespace xrpl::peer_finder {
11
15class Slot
16{
17public:
19
21
22 virtual ~Slot() = 0;
23
27 [[nodiscard]] virtual bool
28 inbound() const = 0;
29
35 [[nodiscard]] virtual bool
36 fixed() const = 0;
37
43 [[nodiscard]] virtual bool
44 reserved() const = 0;
45
49 [[nodiscard]] virtual State
50 state() const = 0;
51
55 [[nodiscard]] virtual beast::ip::Endpoint const&
56 remoteEndpoint() const = 0;
57
61 [[nodiscard]] virtual std::optional<beast::ip::Endpoint> const&
62 localEndpoint() const = 0;
63
64 [[nodiscard]] virtual std::optional<std::uint16_t>
65 listeningPort() const = 0;
66
71 [[nodiscard]] virtual std::optional<PublicKey> const&
72 publicKey() const = 0;
73};
74
75} // namespace xrpl::peer_finder
A version-independent IP address and port combination.
Definition IPEndpoint.h:24
Properties and state associated with a peer to peer overlay connection.
virtual std::optional< std::uint16_t > listeningPort() const =0
virtual State state() const =0
Returns the state of the connection.
virtual std::optional< beast::ip::Endpoint > const & localEndpoint() const =0
The local endpoint of the socket, when known.
virtual bool fixed() const =0
Returns true if this is a fixed connection.
virtual bool inbound() const =0
Returns true if this is an inbound connection.
virtual std::optional< PublicKey > const & publicKey() const =0
The peer's public key, when known.
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.