pion-net
4.0.9
|
#include <HTTPRequestWriter.hpp>
Inherits pion::net::HTTPWriter, and enable_shared_from_this< HTTPRequestWriter >.
Public Member Functions | |
virtual | ~HTTPRequestWriter () |
default destructor | |
HTTPRequest & | getRequest (void) |
returns a non-const reference to the request 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 < HTTPRequestWriter > | create (TCPConnectionPtr &tcp_conn, FinishedHandler handler=FinishedHandler()) |
static boost::shared_ptr < HTTPRequestWriter > | create (TCPConnectionPtr &tcp_conn, HTTPRequestPtr &http_request, FinishedHandler handler=FinishedHandler()) |
Protected Member Functions | |
HTTPRequestWriter (TCPConnectionPtr &tcp_conn, FinishedHandler handler) | |
HTTPRequestWriter (TCPConnectionPtr &tcp_conn, HTTPRequestPtr &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 | |
HTTPRequestWriter: used to asynchronously send HTTP requests
Definition at line 29 of file HTTPRequestWriter.hpp.
|
inlineprotected |
protected constructor restricts creation of objects (use create())
tcp_conn | TCP connection used to send the request |
http_request | pointer to the request that will be sent |
handler | function called after the request has been sent |
Definition at line 83 of file HTTPRequestWriter.hpp.
References pion::net::HTTPWriter::setLogger().
Referenced by create().
|
inlineprotected |
protected constructor restricts creation of objects (use create())
tcp_conn | TCP connection used to send the request |
http_request | pointer to the request that will be sent |
handler | function called after the request has been sent |
Definition at line 96 of file HTTPRequestWriter.hpp.
References pion::net::HTTPWriter::setLogger(), and pion::net::HTTPWriter::writeNoCopy().
|
inlinestatic |
creates new HTTPRequestWriter objects
tcp_conn | TCP connection used to send the request |
handler | function called after the request has been sent |
Definition at line 47 of file HTTPRequestWriter.hpp.
References HTTPRequestWriter().
|
inlinestatic |
creates new HTTPRequestWriter objects
tcp_conn | TCP connection used to send the request |
http_request | pointer to the request that will be sent |
handler | function called after the request has been sent |
Definition at line 63 of file HTTPRequestWriter.hpp.
References HTTPRequestWriter().
|
inlineprotectedvirtual |
called after the request 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 139 of file HTTPRequestWriter.hpp.
References pion::net::HTTPWriter::clear(), pion::net::HTTPWriter::finishedWriting(), pion::net::HTTPWriter::getLogger(), and pion::net::HTTPWriter::sendingChunkedMessage().
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 118 of file HTTPRequestWriter.hpp.
References pion::net::HTTPWriter::getContentLength(), pion::net::HTTPWriter::getTCPConnection(), and pion::net::HTTPWriter::sendingChunkedMessage().