xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
server
detail
PlainWSPeer.h
1
#pragma once
2
3
#include <xrpl/beast/utility/Journal.h>
4
#include <xrpl/server/Port.h>
5
#include <xrpl/server/detail/BaseWSPeer.h>
6
7
#include <boost/beast/core/tcp_stream.hpp>
8
9
#include <
chrono
>
10
#include <
memory
>
11
#include <
utility
>
12
13
namespace
xrpl
{
14
15
template
<
class
Handler>
16
class
PlainWSPeer
:
public
BaseWSPeer
<Handler, PlainWSPeer<Handler>>,
17
public
std::enable_shared_from_this
<PlainWSPeer<Handler>>
18
{
19
friend
class
BasePeer
<Handler,
PlainWSPeer
>;
20
friend
class
BaseWSPeer
<Handler,
PlainWSPeer
>;
21
22
using
ClockType
=
std::chrono::system_clock
;
23
using
ErrorCode
= boost::system::error_code;
24
using
EndpointType
= boost::asio::ip::tcp::endpoint;
25
using
WaitableTimer
= boost::asio::basic_waitable_timer<ClockType>;
26
using
SocketType
= boost::beast::tcp_stream;
27
28
boost::beast::websocket::stream<SocketType>
ws_
;
29
30
public
:
31
template
<
class
Body,
class
Headers>
32
PlainWSPeer
(
33
Port
const
&
port
,
34
Handler& handler,
35
EndpointType
remoteAddress,
36
boost::beast::http::request<Body, Headers>&&
request
,
37
SocketType
&& socket,
38
beast::Journal
journal);
39
};
40
41
//------------------------------------------------------------------------------
42
43
template
<
class
Handler>
44
template
<
class
Body,
class
Headers>
45
PlainWSPeer<Handler>::PlainWSPeer
(
46
Port
const
&
port
,
47
Handler& handler,
48
EndpointType
remoteAddress,
49
boost::beast::http::request<Body, Headers>&&
request
,
50
SocketType
&& socket,
51
beast::Journal
journal)
52
:
BaseWSPeer
<Handler,
PlainWSPeer
>(
53
port
,
54
handler,
55
socket.get_executor(),
56
WaitableTimer
{socket.get_executor()},
57
remoteAddress,
58
std
::move(
request
),
59
journal)
60
,
ws_
(
std
::move(socket))
61
{
62
}
63
64
}
// namespace xrpl
chrono
beast::Journal
A generic endpoint for log messages.
Definition
Journal.h:44
xrpl::BasePeer
Definition
BasePeer.h:21
xrpl::BaseWSPeer< Handler, PlainWSPeer< Handler > >::port
Port const & port() const override
Definition
BaseWSPeer.h:87
xrpl::BaseWSPeer< Handler, PlainWSPeer< Handler > >::request
HttpRequestType const & request() const override
Definition
BaseWSPeer.h:93
xrpl::BaseWSPeer< Handler, PlainWSPeer< Handler > >::BaseWSPeer
BaseWSPeer(Port const &port, Handler &handler, boost::asio::executor const &executor, WaitableTimer timer, EndpointType remoteAddress, boost::beast::http::request< Body, Headers > &&request, beast::Journal journal)
Definition
BaseWSPeer.h:168
xrpl::PlainWSPeer::SocketType
boost::beast::tcp_stream SocketType
Definition
PlainWSPeer.h:26
xrpl::PlainWSPeer::WaitableTimer
boost::asio::basic_waitable_timer< ClockType > WaitableTimer
Definition
PlainWSPeer.h:25
xrpl::PlainWSPeer::ErrorCode
boost::system::error_code ErrorCode
Definition
PlainWSPeer.h:23
xrpl::PlainWSPeer::PlainWSPeer
PlainWSPeer(Port const &port, Handler &handler, EndpointType remoteAddress, boost::beast::http::request< Body, Headers > &&request, SocketType &&socket, beast::Journal journal)
Definition
PlainWSPeer.h:45
xrpl::PlainWSPeer::EndpointType
boost::asio::ip::tcp::endpoint EndpointType
Definition
PlainWSPeer.h:24
xrpl::PlainWSPeer::ws_
boost::beast::websocket::stream< SocketType > ws_
Definition
PlainWSPeer.h:28
xrpl::PlainWSPeer::ClockType
std::chrono::system_clock ClockType
Definition
PlainWSPeer.h:22
std::enable_shared_from_this
memory
std
STL namespace.
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::Port
Configuration information for a Server listening port.
Definition
Port.h:29
std::chrono::system_clock
utility
Generated by
1.17.0