|
xrpld
|
#include <SSLHTTPPeer.h>


Public Member Functions | |
| template<class ConstBufferSequence> | |
| SSLHTTPPeer (Port const &port, Handler &handler, boost::asio::io_context &ioc, beast::Journal journal, EndpointType remoteAddress, ConstBufferSequence const &buffers, MiddleType &&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 | ClockType |
Protected Member Functions | |
| SSLHTTPPeer< Handler > & | impl () |
| void | fail (ErrorCode ec, char const *what) |
| void | startTimer () |
| void | cancelTimer () |
| void | onTimer () |
| void | doRead (YieldContext doYield) |
| void | onWrite (ErrorCode const &ec, std::size_t bytesTransferred) |
| void | doWriter (std::shared_ptr< Writer > const &writer, bool keepAlive, YieldContext 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. | |
| HttpRequestType & | 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_ |
| EndpointType | remoteAddress_ |
| beast::Journal const | journal_ |
| std::string | id_ |
| std::size_t | nid_ |
| boost::asio::streambuf | readBuf_ |
| HttpRequestType | 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 | SocketType = boost::asio::ip::tcp::socket |
| using | MiddleType = boost::beast::tcp_stream |
| using | StreamType = boost::beast::ssl_stream<MiddleType> |
| using | EndpointType = boost::asio::ip::tcp::endpoint |
| using | YieldContext = boost::asio::yield_context |
| using | ErrorCode = boost::system::error_code |
Private Member Functions | |
| void | doHandshake (YieldContext doYield) |
| void | doRequest () override |
| void | doClose () override |
| void | onShutdown (ErrorCode ec) |
| void | destroy () |
Private Attributes | |
| std::unique_ptr< StreamType > | streamPtr_ |
| StreamType & | stream_ |
| SocketType & | socket_ |
| IOList * | ios_ |
Friends | |
| class | BaseHTTPPeer< Handler, SSLHTTPPeer > |
Definition at line 22 of file SSLHTTPPeer.h.
|
private |
Definition at line 27 of file SSLHTTPPeer.h.
|
private |
Definition at line 28 of file SSLHTTPPeer.h.
|
private |
Definition at line 29 of file SSLHTTPPeer.h.
|
private |
Definition at line 30 of file SSLHTTPPeer.h.
|
private |
Definition at line 31 of file SSLHTTPPeer.h.
|
private |
Definition at line 32 of file SSLHTTPPeer.h.
|
protectedinherited |
Definition at line 45 of file BaseHTTPPeer.h.
| xrpl::SSLHTTPPeer< Handler >::SSLHTTPPeer | ( | Port const & | port, |
| Handler & | handler, | ||
| boost::asio::io_context & | ioc, | ||
| beast::Journal | journal, | ||
| EndpointType | remoteAddress, | ||
| ConstBufferSequence const & | buffers, | ||
| MiddleType && | stream ) |
Definition at line 73 of file SSLHTTPPeer.h.
| void xrpl::SSLHTTPPeer< Handler >::run | ( | ) |
Definition at line 97 of file SSLHTTPPeer.h.
|
overridevirtual |
Convert the connection to WebSocket.
Implements xrpl::Session.
Definition at line 114 of file SSLHTTPPeer.h.
|
private |
Definition at line 128 of file SSLHTTPPeer.h.
|
overrideprivatevirtual |
Implements xrpl::BaseHTTPPeer< Handler, SSLHTTPPeer< Handler > >.
Definition at line 155 of file SSLHTTPPeer.h.
|
overrideprivatevirtual |
Implements xrpl::BaseHTTPPeer< Handler, SSLHTTPPeer< Handler > >.
Definition at line 170 of file SSLHTTPPeer.h.
|
private |
Definition at line 180 of file SSLHTTPPeer.h.
|
inherited |
Definition at line 104 of file BaseHTTPPeer.h.
|
overridevirtualinherited |
Implements xrpl::IOList::Work.
Definition at line 110 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 114 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.
|
protectedinherited |
Definition at line 132 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 135 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 138 of file BaseHTTPPeer.h.
|
overrideprotectedvirtualinherited |
Returns the Journal to use for logging.
Implements xrpl::Session.
Definition at line 149 of file BaseHTTPPeer.h.
|
overrideprotectedvirtualinherited |
Returns the Port settings for this connection.
Implements xrpl::Session.
Definition at line 155 of file BaseHTTPPeer.h.
|
overrideprotectedvirtualinherited |
Returns the remote address of the connection.
Implements xrpl::Session.
Definition at line 161 of file BaseHTTPPeer.h.
|
overrideprotectedvirtualinherited |
Returns the current HTTP request.
Implements xrpl::Session.
Definition at line 167 of file BaseHTTPPeer.h.
|
overrideprotectedvirtualinherited |
Implements xrpl::Session.
Definition at line 173 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 179 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 182 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 180 of file SSLHTTPPeer.h.
|
private |
Definition at line 34 of file SSLHTTPPeer.h.
|
private |
Definition at line 35 of file SSLHTTPPeer.h.
|
private |
Definition at line 36 of file SSLHTTPPeer.h.
|
staticconstexprprotectedinherited |
Definition at line 50 of file BaseHTTPPeer.h.
|
staticconstexprprotectedinherited |
Definition at line 51 of file BaseHTTPPeer.h.
|
staticconstexprprotectedinherited |
Definition at line 52 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 66 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 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.
|
protectedinherited |
Definition at line 79 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 80 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 81 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 82 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 83 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 85 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 86 of file BaseHTTPPeer.h.
|
protectedinherited |
Definition at line 87 of file BaseHTTPPeer.h.
|
privateinherited |
|
inherited |