pion-net
4.0.9
|
#include <HTTPResponseWriter.hpp>
Inherits pion::net::HTTPWriter.
Public Member Functions | |
virtual | ~HTTPResponseWriter () |
default destructor | |
HTTPResponse & | getResponse (void) |
returns a non-const reference to the response that will be sent | |
![]() | |
virtual | ~HTTPWriter () |
default destructor | |
void | clear (void) |
clears out all of the memory buffers used to cache payload content data | |
template<typename T > | |
void | write (const T &data) |
void | write (const void *data, size_t length) |
void | writeNoCopy (const std::string &data) |
void | writeNoCopy (void *data, size_t length) |
void | send (void) |
template<typename SendHandler > | |
void | send (SendHandler send_handler) |
template<typename SendHandler > | |
void | sendChunk (SendHandler send_handler) |
template<typename SendHandler > | |
void | sendFinalChunk (SendHandler send_handler) |
void | sendFinalChunk (void) |
TCPConnectionPtr & | getTCPConnection (void) |
returns a shared pointer to the TCP connection | |
size_t | getContentLength (void) const |
returns the length of the payload content (in bytes) | |
void | supportsChunkedMessages (bool b) |
sets whether or not the client supports chunked messages | |
bool | supportsChunkedMessages () const |
returns true if the client supports chunked messages | |
bool | sendingChunkedMessage () const |
returns true if we are sending a chunked message to the client | |
void | setLogger (PionLogger log_ptr) |
sets the logger to be used | |
PionLogger | getLogger (void) |
returns the logger currently in use |
Static Public Member Functions | |
static boost::shared_ptr < HTTPResponseWriter > | create (TCPConnectionPtr &tcp_conn, HTTPResponsePtr &http_response, FinishedHandler handler=FinishedHandler()) |
static boost::shared_ptr < HTTPResponseWriter > | create (TCPConnectionPtr &tcp_conn, const HTTPRequest &http_request, FinishedHandler handler=FinishedHandler()) |
Protected Member Functions | |
HTTPResponseWriter (TCPConnectionPtr &tcp_conn, HTTPResponsePtr &http_response, FinishedHandler handler) | |
HTTPResponseWriter (TCPConnectionPtr &tcp_conn, const HTTPRequest &http_request, FinishedHandler handler) | |
virtual void | prepareBuffersForSend (HTTPMessage::WriteBuffers &write_buffers) |
virtual WriteHandler | bindToWriteHandler (void) |
returns a function bound to HTTPWriter::handleWrite() | |
virtual void | handleWrite (const boost::system::error_code &write_error, std::size_t bytes_written) |
![]() | |
HTTPWriter (TCPConnectionPtr &tcp_conn, FinishedHandler handler) | |
void | finishedWriting (const boost::system::error_code &ec) |
called after we have finished sending the HTTP message |
Additional Inherited Members | |
![]() | |
typedef boost::function1< void, const boost::system::error_code & > | FinishedHandler |
function called after the HTTP message has been sent | |
typedef boost::function2< void, const boost::system::error_code &, std::size_t > | WriteHandler |
data type for a function that handles write operations |
HTTPResponseWriter: used to asynchronously send HTTP responses
Definition at line 30 of file HTTPResponseWriter.hpp.
|
inlineprotected |
protected constructor restricts creation of objects (use create())
tcp_conn | TCP connection used to send the response |
http_response | pointer to the response that will be sent |
handler | function called after the request has been sent |
Definition at line 86 of file HTTPResponseWriter.hpp.
|
inlineprotected |
protected constructor restricts creation of objects (use create())
tcp_conn | TCP connection used to send the response |
http_request | the request we are responding to |
handler | function called after the request has been sent |
Definition at line 110 of file HTTPResponseWriter.hpp.
|
inlinestatic |
creates new HTTPResponseWriter objects
tcp_conn | TCP connection used to send the response |
http_response | pointer to the response that will be sent |
handler | function called after the response has been sent |
Definition at line 49 of file HTTPResponseWriter.hpp.
Referenced by pion::net::HTTPServer::handleBadRequest(), pion::net::HTTPServer::handleForbiddenRequest(), pion::net::HTTPServer::handleMethodNotAllowed(), pion::net::HTTPServer::handleNotFoundRequest(), pion::net::HTTPCookieAuth::handleOk(), pion::net::HTTPCookieAuth::handleRedirection(), pion::net::HTTPServer::handleServerError(), pion::net::HTTPBasicAuth::handleUnauthorized(), and pion::net::HTTPCookieAuth::handleUnauthorized().
|
inlinestatic |
creates new HTTPResponseWriter objects
tcp_conn | TCP connection used to send the response |
http_request | the request we are responding to |
handler | function called after the request has been sent |
Definition at line 66 of file HTTPResponseWriter.hpp.
|
inlineprotectedvirtual |
called after the response is sent
write_error | error status from the last write operation |
bytes_written | number of bytes sent by the last write operation |
Implements pion::net::HTTPWriter.
Definition at line 146 of file HTTPResponseWriter.hpp.
Referenced by bindToWriteHandler().
|
inlineprotectedvirtual |
initializes a vector of write buffers with the HTTP message information
write_buffers | vector of write buffers to initialize |
Implements pion::net::HTTPWriter.
Definition at line 125 of file HTTPResponseWriter.hpp.