|
xrpld
|
#include <PlainHTTPPeer.h>


Public Member Functions | |
| template<class ConstBufferSequence> | |
| PlainHTTPPeer (Port const &port, Handler &handler, boost::asio::io_context &ioc, beast::Journal journal, endpoint_type remoteAddress, ConstBufferSequence const &buffers, stream_type &&stream) | |
| void | run () |
| std::shared_ptr< WSSession > | websocketUpgrade () override |
| Convert the connection to WebSocket. | |
| Session & | session () |
| void | close () override |
| virtual void | close (bool graceful)=0 |
| Close the session. | |
| IOList & | ios () |
| Return the IOList associated with the work. | |
| T | shared_from_this (T... args) |
| T | weak_from_this (T... args) |
| void | write (std::string_view s) |
| Send a copy of data asynchronously. | |
| void | write (BufferSequence const &buffers) |
| virtual void | write (std::shared_ptr< Writer > const &writer, bool keepAlive)=0 |
Public Attributes | |
| void * | tag |
| A user-definable pointer. | |
Protected Types | |
| using | clock_type |
| using | error_code |
| using | yield_context |
Protected Member Functions | |
| PlainHTTPPeer< Handler > & | impl () |
| void | fail (error_code ec, char const *what) |
| void | startTimer () |
| void | cancelTimer () |
| void | onTimer () |
| void | doRead (yield_context doYield) |
| void | onWrite (error_code const &ec, std::size_t bytesTransferred) |
| void | doWriter (std::shared_ptr< Writer > const &writer, bool keepAlive, yield_context doYield) |
| beast::Journal | journal () override |
| Returns the Journal to use for logging. | |
| Port const & | port () override |
| Returns the Port settings for this connection. | |
| beast::IP::Endpoint | remoteAddress () override |
| Returns the remote address of the connection. | |
| http_request_type & | request () override |
| Returns the current HTTP request. | |
| void | write (void const *buffer, std::size_t bytes) override |
| std::shared_ptr< Session > | detach () override |
| Detach the session. | |
| void | complete () override |
| Indicate that the response is complete. | |
Protected Attributes | |
| Port const & | port_ |
| Handler & | handler_ |
| boost::asio::executor_work_guard< boost::asio::executor > | work_ |
| boost::asio::strand< boost::asio::executor > | strand_ |
| endpoint_type | remoteAddress_ |
| beast::Journal const | journal_ |
| std::string | id_ |
| std::size_t | nid_ |
| boost::asio::streambuf | readBuf_ |
| http_request_type | message_ |
| std::vector< Buffer > | wq_ |
| std::vector< Buffer > | wq2_ |
| std::mutex | mutex_ |
| bool | graceful_ |
| bool | complete_ |
| boost::system::error_code | ec_ |
| int | requestCount_ |
| std::size_t | bytesIn_ |
| std::size_t | bytesOut_ |
Static Protected Attributes | |
| static constexpr auto | kBufferSize |
| static constexpr auto | kTimeoutSeconds |
| static constexpr auto | kTimeoutSecondsLocal |
Private Types | |
| using | socket_type = boost::asio::ip::tcp::socket |
| using | stream_type = boost::beast::tcp_stream |
| using | endpoint_type = boost::asio::ip::tcp::endpoint |
Private Member Functions | |
| void | doRequest () override |
| void | doClose () override |
| void | destroy () |
Private Attributes | |
| stream_type | stream_ |
| socket_type & | socket_ |
| IOList * | ios_ |
Friends | |
| class | BaseHTTPPeer< Handler, PlainHTTPPeer > |
Definition at line 14 of file PlainHTTPPeer.h.
|
private |
Definition at line 19 of file PlainHTTPPeer.h.
|
private |
Definition at line 20 of file PlainHTTPPeer.h.
|
private |
Definition at line 21 of file PlainHTTPPeer.h.
|
protectedinherited |
Definition at line 36 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 37 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 39 of file BaseHTTPPeer.h.
| xrpl::PlainHTTPPeer< Handler >::PlainHTTPPeer | ( | Port const & | port, |
| Handler & | handler, | ||
| boost::asio::io_context & | ioc, | ||
| beast::Journal | journal, | ||
| endpoint_type | remoteAddress, | ||
| ConstBufferSequence const & | buffers, | ||
| stream_type && | stream ) |
Definition at line 55 of file PlainHTTPPeer.h.
| void xrpl::PlainHTTPPeer< Handler >::run | ( | ) |
Definition at line 83 of file PlainHTTPPeer.h.
|
overridevirtual |
Convert the connection to WebSocket.
Implements xrpl::Session.
Definition at line 101 of file PlainHTTPPeer.h.
|
overrideprivatevirtual |
Implements xrpl::BaseHTTPPeer< Handler, PlainHTTPPeer< Handler > >.
Definition at line 115 of file PlainHTTPPeer.h.
|
overrideprivatevirtual |
Implements xrpl::BaseHTTPPeer< Handler, PlainHTTPPeer< Handler > >.
Definition at line 144 of file PlainHTTPPeer.h.
|
inherited |
Definition at line 95 of file BaseHTTPPeer.h.
|
overridevirtualinherited |
Implements xrpl::IOList::Work.
Definition at line 101 of file BaseHTTPPeer.h.
|
pure virtualinherited |
Close the session.
This will be performed asynchronously. The session will be closed gracefully after all pending writes have completed.
| graceful | true to wait until all data has finished sending. |
Implemented in xrpl::BaseHTTPPeer< Handler, Impl >.
|
protectedinherited |
Definition at line 105 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 111 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 114 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 117 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 120 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 123 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 126 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 129 of file BaseHTTPPeer.h.
|
overrideprotectedvirtualinherited |
Returns the Journal to use for logging.
Implements xrpl::Session.
Definition at line 140 of file BaseHTTPPeer.h.
|
overrideprotectedvirtualinherited |
Returns the Port settings for this connection.
Implements xrpl::Session.
Definition at line 146 of file BaseHTTPPeer.h.
|
overrideprotectedvirtualinherited |
Returns the remote address of the connection.
Implements xrpl::Session.
Definition at line 152 of file BaseHTTPPeer.h.
|
overrideprotectedvirtualinherited |
Returns the current HTTP request.
Implements xrpl::Session.
Definition at line 158 of file BaseHTTPPeer.h.
|
overrideprotectedvirtualinherited |
Implements xrpl::Session.
Definition at line 164 of file BaseHTTPPeer.h.
|
inherited |
|
inherited |
|
pure virtualinherited |
Implemented in xrpl::BaseHTTPPeer< Handler, Impl >.
|
overrideprotectedvirtualinherited |
Detach the session.
This holds the session open so that the response can be sent asynchronously. Calls to io_context::run made by the server will not return until all detached sessions are closed.
Implements xrpl::Session.
Definition at line 170 of file BaseHTTPPeer.h.
|
overrideprotectedvirtualinherited |
Indicate that the response is complete.
The handler should call this when it has completed writing the response. If Keep-Alive is indicated on the connection, this will trigger a read for the next request; else, the connection will be closed when all remaining data has been sent.
Implements xrpl::Session.
Definition at line 173 of file BaseHTTPPeer.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 144 of file PlainHTTPPeer.h.
|
private |
Definition at line 23 of file PlainHTTPPeer.h.
|
private |
Definition at line 24 of file PlainHTTPPeer.h.
|
staticconstexprprotectedinherited |
Definition at line 41 of file BaseHTTPPeer.h.
|
staticconstexprprotectedinherited |
Definition at line 42 of file BaseHTTPPeer.h.
|
staticconstexprprotectedinherited |
Definition at line 43 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 57 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 58 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 59 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 60 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 61 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 62 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 64 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 65 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 67 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 68 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 69 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 70 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 71 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 72 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 73 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 74 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 76 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 77 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 78 of file BaseHTTPPeer.h.
|
privateinherited |
|
inherited |