A Connection object represents the state (and socket) for an ongoing, active, HTTP Connection, managed by the ConnectionManager class. More...
#include <Connection.h>
Classes | |
struct | Stats |
Public Member Functions | |
nonvirtual ReadAndProcessResult | ReadAndProcessMessage () noexcept |
nonvirtual String | ToString (bool abbreviatedOutput=true) const |
Public Attributes | |
const Common::ReadOnlyProperty< ConnectionOrientedStreamSocket::Ptr > | socket |
const Common::ReadOnlyProperty< const Request & > | request |
const Common::ReadOnlyProperty< const Response & > | response |
Common::ReadOnlyProperty< Response & > | rwResponse |
const Common::ReadOnlyProperty< Stats > | stats |
retrieve stats about this connection, like threads used, start/end times. NB: INTERNALLY SYNCRONIZED | |
Common::Property< optional< HTTP::KeepAlive > > | remainingConnectionLimits |
A Connection object represents the state (and socket) for an ongoing, active, HTTP Connection, managed by the ConnectionManager class.
This tends to get used internally by the ConnectionManager, but you can use it directly. For example:
Definition at line 79 of file Frameworks/WebServer/Connection.h.
|
noexcept |
Return eTryAgainLater if 'keep alive' (or otherwise should try again - like incomplete input).
Delegate to interceptor chain. This is the principle EXTENSION point for the Stroika Framework webserver. This is where you modify the response somehow or other (typically through routes).
Definition at line 313 of file Frameworks/WebServer/Connection.cpp.
String Connection::ToString | ( | bool | abbreviatedOutput = true | ) | const |
Definition at line 554 of file Frameworks/WebServer/Connection.cpp.
const Common::ReadOnlyProperty<ConnectionOrientedStreamSocket::Ptr> Stroika::Frameworks::WebServer::Connection::socket |
This returns the (two way) connection oriented stream socket (ptr) used by this connection.
Definition at line 135 of file Frameworks/WebServer/Connection.h.
const Common::ReadOnlyProperty<const Request&> Stroika::Frameworks::WebServer::Connection::request |
Access a (read-only) reference of the underlying connection request
Definition at line 141 of file Frameworks/WebServer/Connection.h.
const Common::ReadOnlyProperty<const Response&> Stroika::Frameworks::WebServer::Connection::response |
Access a (read-only) reference of the underlying connection request
Definition at line 147 of file Frameworks/WebServer/Connection.h.
Common::ReadOnlyProperty<Response&> Stroika::Frameworks::WebServer::Connection::rwResponse |
Access a (read-only) reference to the underlying (modifiable) connection response (meaning you cannot assign to the response itself, but you can modify the response object)
Definition at line 153 of file Frameworks/WebServer/Connection.h.
const Common::ReadOnlyProperty<Stats> Stroika::Frameworks::WebServer::Connection::stats |
retrieve stats about this connection, like threads used, start/end times. NB: INTERNALLY SYNCRONIZED
\note \em Thread-Safety <a href='#Internally-Synchronized-Thread-Safety'>Internally-Synchronized-Thread-Safety</a>
Definition at line 216 of file Frameworks/WebServer/Connection.h.
Common::Property<optional<HTTP::KeepAlive> > Stroika::Frameworks::WebServer::Connection::remainingConnectionLimits |
Definition at line 241 of file Frameworks/WebServer/Connection.h.