|
rippled
|
Persistent state information for a connection session. More...
#include <Session.h>

Public Member Functions | |
| Session ()=default | |
| Session (Session const &)=delete | |
| Session & | operator= (Session const &)=delete |
| virtual | ~Session ()=default |
| virtual beast::Journal | journal ()=0 |
| Returns the Journal to use for logging. | |
| virtual Port const & | port ()=0 |
| Returns the Port settings for this connection. | |
| virtual beast::IP::Endpoint | remoteAddress ()=0 |
| Returns the remote address of the connection. | |
| virtual http_request_type & | request ()=0 |
| Returns the current HTTP request. | |
| virtual std::shared_ptr< Session > | detach ()=0 |
| Detach the session. | |
| virtual void | complete ()=0 |
| Indicate that the response is complete. | |
| virtual void | close (bool graceful)=0 |
| Close the session. | |
| virtual std::shared_ptr< WSSession > | websocketUpgrade ()=0 |
| Convert the connection to WebSocket. | |
| void | write (std::string const &s) |
| Send a copy of data asynchronously. | |
| template<typename BufferSequence > | |
| void | write (BufferSequence const &buffers) |
| virtual void | write (void const *buffer, std::size_t bytes)=0 |
| virtual void | write (std::shared_ptr< Writer > const &writer, bool keep_alive)=0 |
Public Attributes | |
| void * | tag = nullptr |
| A user-definable pointer. | |
Persistent state information for a connection session.
These values are preserved between calls for efficiency. Some fields are input parameters, some are output parameters, and all only become defined during specific callbacks.
|
default |
|
delete |
|
virtualdefault |
|
pure virtual |
Returns the Journal to use for logging.
Implemented in ripple::BaseHTTPPeer< Handler, Impl >, ripple::BaseHTTPPeer< Handler, PlainHTTPPeer< Handler > >, and ripple::BaseHTTPPeer< Handler, SSLHTTPPeer< Handler > >.
|
pure virtual |
Returns the Port settings for this connection.
Implemented in ripple::BaseHTTPPeer< Handler, Impl >, ripple::BaseHTTPPeer< Handler, PlainHTTPPeer< Handler > >, and ripple::BaseHTTPPeer< Handler, SSLHTTPPeer< Handler > >.
|
pure virtual |
Returns the remote address of the connection.
Implemented in ripple::BaseHTTPPeer< Handler, Impl >, ripple::BaseHTTPPeer< Handler, PlainHTTPPeer< Handler > >, and ripple::BaseHTTPPeer< Handler, SSLHTTPPeer< Handler > >.
|
pure virtual |
Returns the current HTTP request.
Implemented in ripple::BaseHTTPPeer< Handler, Impl >, ripple::BaseHTTPPeer< Handler, PlainHTTPPeer< Handler > >, and ripple::BaseHTTPPeer< Handler, SSLHTTPPeer< Handler > >.
| void ripple::Session::write | ( | std::string const & | s | ) |
| void ripple::Session::write | ( | BufferSequence const & | buffers | ) |
|
pure virtual |
|
pure virtual |
|
pure virtual |
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.
Implemented in ripple::BaseHTTPPeer< Handler, Impl >, ripple::BaseHTTPPeer< Handler, PlainHTTPPeer< Handler > >, and ripple::BaseHTTPPeer< Handler, SSLHTTPPeer< Handler > >.
|
pure virtual |
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.
Implemented in ripple::BaseHTTPPeer< Handler, Impl >, ripple::BaseHTTPPeer< Handler, PlainHTTPPeer< Handler > >, and ripple::BaseHTTPPeer< Handler, SSLHTTPPeer< Handler > >.
|
pure virtual |
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 ripple::BaseHTTPPeer< Handler, Impl >, ripple::BaseHTTPPeer< Handler, PlainHTTPPeer< Handler > >, and ripple::BaseHTTPPeer< Handler, SSLHTTPPeer< Handler > >.
|
pure virtual |
Convert the connection to WebSocket.
Implemented in ripple::PlainHTTPPeer< Handler >, and ripple::SSLHTTPPeer< Handler >.