xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
peerfinder
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
10
namespace
xrpl::peer_finder
{
11
15
class
Slot
16
{
17
public
:
18
using
Ptr
=
std::shared_ptr<Slot>
;
19
20
enum class
State
{
Accept
,
Connect
,
Connected
,
Active
,
Closing
};
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
beast::ip::Endpoint
A version-independent IP address and port combination.
Definition
IPEndpoint.h:24
xrpl::peer_finder::Slot
Properties and state associated with a peer to peer overlay connection.
Definition
include/xrpl/peerfinder/Slot.h:16
xrpl::peer_finder::Slot::Ptr
std::shared_ptr< Slot > Ptr
Definition
include/xrpl/peerfinder/Slot.h:18
xrpl::peer_finder::Slot::listeningPort
virtual std::optional< std::uint16_t > listeningPort() const =0
xrpl::peer_finder::Slot::~Slot
virtual ~Slot()=0
xrpl::peer_finder::Slot::state
virtual State state() const =0
Returns the state of the connection.
xrpl::peer_finder::Slot::localEndpoint
virtual std::optional< beast::ip::Endpoint > const & localEndpoint() const =0
The local endpoint of the socket, when known.
xrpl::peer_finder::Slot::fixed
virtual bool fixed() const =0
Returns true if this is a fixed connection.
xrpl::peer_finder::Slot::inbound
virtual bool inbound() const =0
Returns true if this is an inbound connection.
xrpl::peer_finder::Slot::publicKey
virtual std::optional< PublicKey > const & publicKey() const =0
The peer's public key, when known.
xrpl::peer_finder::Slot::State
State
Definition
include/xrpl/peerfinder/Slot.h:20
xrpl::peer_finder::Slot::State::Connected
@ Connected
Definition
include/xrpl/peerfinder/Slot.h:20
xrpl::peer_finder::Slot::State::Connect
@ Connect
Definition
include/xrpl/peerfinder/Slot.h:20
xrpl::peer_finder::Slot::State::Active
@ Active
Definition
include/xrpl/peerfinder/Slot.h:20
xrpl::peer_finder::Slot::State::Closing
@ Closing
Definition
include/xrpl/peerfinder/Slot.h:20
xrpl::peer_finder::Slot::State::Accept
@ Accept
Definition
include/xrpl/peerfinder/Slot.h:20
xrpl::peer_finder::Slot::remoteEndpoint
virtual beast::ip::Endpoint const & remoteEndpoint() const =0
The remote endpoint of socket.
xrpl::peer_finder::Slot::reserved
virtual bool reserved() const =0
Returns true if this is a reserved connection.
cstdint
memory
xrpl::peer_finder
Definition
include/xrpl/peerfinder/Config.h:12
optional
std::shared_ptr
Generated by
1.17.0