|
xrpld
|
Represents an active WebSocket connection. More...
#include <BaseWSPeer.h>


Public Member Functions | |
| template<class Body, class Headers> | |
| 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) | |
| void | run () override |
| Port const & | port () const override |
| HttpRequestType const & | request () const override |
| boost::asio::ip::tcp::endpoint const & | remoteEndpoint () const override |
| void | send (std::shared_ptr< WSMsg > w) override |
| Send a WebSockets message. | |
| void | close () override |
| void | close (boost::beast::websocket::close_reason const &reason) override |
| void | complete () override |
| Indicate that the response is complete. | |
| IOList & | ios () |
| Return the IOList associated with the work. | |
Public Attributes | |
| std::shared_ptr< void > | appDefined |
Protected Types | |
| using | ClockType = std::chrono::system_clock |
| using | ErrorCode = boost::system::error_code |
| using | EndpointType = boost::asio::ip::tcp::endpoint |
| using | WaitableTimer = boost::asio::basic_waitable_timer<ClockType> |
Protected Member Functions | |
| Impl & | impl () |
| void | onWsHandshake (ErrorCode const &ec) |
| void | doWrite () |
| void | onWrite (ErrorCode const &ec) |
| void | onWriteFin (ErrorCode const &ec) |
| void | doRead () |
| void | onRead (ErrorCode const &ec) |
| void | onClose (ErrorCode const &ec) |
| void | startTimer () |
| void | cancelTimer () |
| void | onPing (ErrorCode const &ec) |
| void | onPingPong (boost::beast::websocket::frame_type kind, std::string_view payload) |
| void | onTimer (ErrorCode ec) |
| template<class String> | |
| void | fail (ErrorCode ec, String const &what) |
Protected Attributes | |
| Port const & | port_ |
| Handler & | handler_ |
| EndpointType | remoteAddress_ |
| beast::WrappedSink | sink_ |
| beast::Journal const | j_ |
| boost::asio::executor_work_guard< boost::asio::executor > | work_ |
| boost::asio::strand< boost::asio::executor > | strand_ |
Private Member Functions | |
| template<class = void> | |
| void | destroy () |
Private Attributes | |
| HttpRequestType | request_ |
| boost::beast::multi_buffer | rb_ |
| boost::beast::multi_buffer | wb_ |
| std::list< std::shared_ptr< WSMsg > > | wq_ |
| bool | doClose_ = false |
| The socket has been closed, or will close after the next write finishes. | |
| boost::beast::websocket::close_reason | cr_ |
| WaitableTimer | timer_ |
| bool | closeOnTimer_ = false |
| bool | pingActive_ = false |
| boost::beast::websocket::ping_data | payload_ |
| ErrorCode | ec_ |
| std::function< void(boost::beast::websocket::frame_type, std::string_view)> | controlCallback_ |
| IOList * | ios_ = nullptr |
Friends | |
| class | BasePeer< Handler, Impl > |
Represents an active WebSocket connection.
Definition at line 38 of file BaseWSPeer.h.
|
protected |
Definition at line 41 of file BaseWSPeer.h.
|
protected |
Definition at line 42 of file BaseWSPeer.h.
|
protected |
Definition at line 43 of file BaseWSPeer.h.
|
protected |
Definition at line 44 of file BaseWSPeer.h.
| xrpl::BaseWSPeer< Handler, Impl >::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 at line 168 of file BaseWSPeer.h.
|
overridevirtual |
Implements xrpl::WSSession.
Definition at line 185 of file BaseWSPeer.h.
|
nodiscardoverridevirtual |
Implements xrpl::WSSession.
Definition at line 87 of file BaseWSPeer.h.
|
nodiscardoverridevirtual |
Implements xrpl::WSSession.
Definition at line 93 of file BaseWSPeer.h.
|
nodiscardoverridevirtual |
Implements xrpl::WSSession.
Definition at line 99 of file BaseWSPeer.h.
|
overridevirtual |
|
overridevirtual |
Reimplemented from xrpl::BasePeer< Handler, Impl >.
Definition at line 234 of file BaseWSPeer.h.
|
overridevirtual |
Implements xrpl::WSSession.
Definition at line 241 of file BaseWSPeer.h.
|
overridevirtual |
Indicate that the response is complete.
The handler should call this when it has completed writing the response.
Implements xrpl::WSSession.
Definition at line 265 of file BaseWSPeer.h.
|
protected |
Definition at line 118 of file BaseWSPeer.h.
|
protected |
Definition at line 274 of file BaseWSPeer.h.
|
protected |
Definition at line 284 of file BaseWSPeer.h.
|
protected |
Definition at line 293 of file BaseWSPeer.h.
|
protected |
Definition at line 326 of file BaseWSPeer.h.
|
protected |
Definition at line 346 of file BaseWSPeer.h.
|
protected |
Definition at line 360 of file BaseWSPeer.h.
|
protected |
Definition at line 376 of file BaseWSPeer.h.
|
protected |
Definition at line 383 of file BaseWSPeer.h.
|
protected |
Definition at line 405 of file BaseWSPeer.h.
|
protected |
Definition at line 419 of file BaseWSPeer.h.
|
protected |
Definition at line 431 of file BaseWSPeer.h.
|
protected |
Definition at line 452 of file BaseWSPeer.h.
|
protected |
Definition at line 481 of file BaseWSPeer.h.
|
privateinherited |
|
inherited |
Return the IOList associated with the work.
Requirements: The call to IOList::emplace to create the work has already returned.
|
friend |
Definition at line 481 of file BaseWSPeer.h.
|
private |
Definition at line 50 of file BaseWSPeer.h.
|
private |
Definition at line 51 of file BaseWSPeer.h.
|
private |
Definition at line 52 of file BaseWSPeer.h.
|
private |
Definition at line 53 of file BaseWSPeer.h.
|
private |
The socket has been closed, or will close after the next write finishes.
Do not do any more writes, and don't try to close again.
Definition at line 59 of file BaseWSPeer.h.
|
private |
Definition at line 60 of file BaseWSPeer.h.
|
private |
Definition at line 61 of file BaseWSPeer.h.
|
private |
Definition at line 62 of file BaseWSPeer.h.
|
private |
Definition at line 63 of file BaseWSPeer.h.
|
private |
Definition at line 64 of file BaseWSPeer.h.
|
private |
Definition at line 65 of file BaseWSPeer.h.
|
private |
Definition at line 66 of file BaseWSPeer.h.
|
protectedinherited |
Definition at line 28 of file BasePeer.h.
|
protectedinherited |
Definition at line 29 of file BasePeer.h.
|
protectedinherited |
Definition at line 30 of file BasePeer.h.
|
protectedinherited |
Definition at line 31 of file BasePeer.h.
|
protectedinherited |
Definition at line 32 of file BasePeer.h.
|
protectedinherited |
Definition at line 34 of file BasePeer.h.
|
protectedinherited |
Definition at line 35 of file BasePeer.h.
|
privateinherited |
|
inherited |
Definition at line 90 of file WSSession.h.