| 
    rippled
    
   | 
 
#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 remote_address, ConstBufferSequence const &buffers, stream_type &&stream) | |
| void | run () | 
| std::shared_ptr< WSSession > | websocketUpgrade () override | 
| Convert the connection to WebSocket.   | |
| Session & | session () | 
| void | close () override | 
| io_list & | ios () | 
| Return the io_list associated with the work.   | |
| T | shared_from_this (T... args) | 
| T | weak_from_this (T... args) | 
| void | write (std::string const &s) | 
| Send a copy of data asynchronously.   | |
| template<typename BufferSequence > | |
| void | write (BufferSequence const &buffers) | 
Public Attributes | |
| void * | tag = nullptr | 
| A user-definable pointer.   | |
Protected Types | |
| enum | |
| using | clock_type = std::chrono::system_clock | 
| using | error_code = boost::system::error_code | 
| using | yield_context = boost::asio::yield_context | 
Protected Member Functions | |
| void | close (bool graceful) override | 
| Close the session.   | |
| PlainHTTPPeer< Handler > & | impl () | 
| void | fail (error_code ec, char const *what) | 
| void | start_timer () | 
| void | cancel_timer () | 
| void | on_timer () | 
| void | do_read (yield_context do_yield) | 
| void | on_write (error_code const &ec, std::size_t bytes_transferred) | 
| void | do_writer (std::shared_ptr< Writer > const &writer, bool keep_alive, yield_context do_yield) | 
| 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 | 
| void | write (std::shared_ptr< Writer > const &writer, bool keep_alive) 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 | remote_address_ | 
| beast::Journal const | journal_ | 
| std::string | id_ | 
| std::size_t | nid_ | 
| boost::asio::streambuf | read_buf_ | 
| 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 | request_count_ | 
| std::size_t | bytes_in_ | 
| std::size_t | bytes_out_ | 
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 | do_request () override | 
| void | do_close () override | 
| template<class = void> | |
| void | destroy () | 
Private Attributes | |
| stream_type | stream_ | 
| socket_type & | socket_ | 
| io_list * | ios_ = nullptr | 
Friends | |
| class | BaseHTTPPeer< Handler, PlainHTTPPeer > | 
Definition at line 34 of file PlainHTTPPeer.h.
      
  | 
  private | 
Definition at line 40 of file PlainHTTPPeer.h.
      
  | 
  private | 
Definition at line 41 of file PlainHTTPPeer.h.
      
  | 
  private | 
Definition at line 42 of file PlainHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 55 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 56 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 58 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 60 of file BaseHTTPPeer.h.
| ripple::PlainHTTPPeer< Handler >::PlainHTTPPeer | ( | Port const & | port, | 
| Handler & | handler, | ||
| boost::asio::io_context & | ioc, | ||
| beast::Journal | journal, | ||
| endpoint_type | remote_address, | ||
| ConstBufferSequence const & | buffers, | ||
| stream_type && | stream | ||
| ) | 
Definition at line 76 of file PlainHTTPPeer.h.
| void ripple::PlainHTTPPeer< Handler >::run | ( | ) | 
Definition at line 104 of file PlainHTTPPeer.h.
      
  | 
  overridevirtual | 
Convert the connection to WebSocket.
Implements ripple::Session.
Definition at line 127 of file PlainHTTPPeer.h.
      
  | 
  overrideprivatevirtual | 
Implements ripple::BaseHTTPPeer< Handler, PlainHTTPPeer< Handler > >.
Definition at line 141 of file PlainHTTPPeer.h.
      
  | 
  overrideprivatevirtual | 
Implements ripple::BaseHTTPPeer< Handler, PlainHTTPPeer< Handler > >.
Definition at line 170 of file PlainHTTPPeer.h.
      
  | 
  inherited | 
Definition at line 120 of file BaseHTTPPeer.h.
      
  | 
  overridevirtualinherited | 
Implements ripple::io_list::work.
Definition at line 126 of file BaseHTTPPeer.h.
      
  | 
  overrideprotectedvirtualinherited | 
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.  | 
Implements ripple::Session.
Definition at line 204 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 130 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 136 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 139 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 142 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 145 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 148 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 151 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 154 of file BaseHTTPPeer.h.
      
  | 
  overrideprotectedvirtualinherited | 
Returns the Journal to use for logging.
Implements ripple::Session.
Definition at line 168 of file BaseHTTPPeer.h.
      
  | 
  overrideprotectedvirtualinherited | 
Returns the Port settings for this connection.
Implements ripple::Session.
Definition at line 174 of file BaseHTTPPeer.h.
      
  | 
  overrideprotectedvirtualinherited | 
Returns the remote address of the connection.
Implements ripple::Session.
Definition at line 180 of file BaseHTTPPeer.h.
      
  | 
  overrideprotectedvirtualinherited | 
Returns the current HTTP request.
Implements ripple::Session.
Definition at line 186 of file BaseHTTPPeer.h.
      
  | 
  overrideprotectedvirtualinherited | 
Implements ripple::Session.
Definition at line 192 of file BaseHTTPPeer.h.
      
  | 
  overrideprotectedvirtualinherited | 
Implements ripple::Session.
Definition at line 195 of file BaseHTTPPeer.h.
      
  | 
  inherited | 
      
  | 
  inherited | 
      
  | 
  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 ripple::Session.
Definition at line 198 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 ripple::Session.
Definition at line 201 of file BaseHTTPPeer.h.
      
  | 
  privateinherited | 
      
  | 
  inherited | 
Return the io_list associated with the work.
Requirements: The call to io_list::emplace to create the work has already returned.
      
  | 
  friend | 
Definition at line 170 of file PlainHTTPPeer.h.
      
  | 
  private | 
Definition at line 44 of file PlainHTTPPeer.h.
      
  | 
  private | 
Definition at line 45 of file PlainHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 82 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 83 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 84 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.
      
  | 
  protectedinherited | 
Definition at line 89 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 90 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 92 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 93 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 94 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 95 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 96 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 97 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 98 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 99 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 101 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 102 of file BaseHTTPPeer.h.
      
  | 
  protectedinherited | 
Definition at line 103 of file BaseHTTPPeer.h.
      
  | 
  privateinherited |