pion-net  4.0.9
Public Member Functions | Static Public Member Functions | Protected Member Functions
pion::net::HTTPRequestWriter Class Reference

#include <HTTPRequestWriter.hpp>

Inherits pion::net::HTTPWriter.

List of all members.

Public Member Functions

virtual ~HTTPRequestWriter ()
 default destructor
HTTPRequestgetRequest (void)
 returns a non-const reference to the request that will be sent

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)

Detailed Description

HTTPRequestWriter: used to asynchronously send HTTP requests

Definition at line 29 of file HTTPRequestWriter.hpp.


Constructor & Destructor Documentation

pion::net::HTTPRequestWriter::HTTPRequestWriter ( TCPConnectionPtr &  tcp_conn,
FinishedHandler  handler 
) [inline, protected]

protected constructor restricts creation of objects (use create())

Parameters:
tcp_connTCP connection used to send the request
http_requestpointer to the request that will be sent
handlerfunction called after the request has been sent

Definition at line 83 of file HTTPRequestWriter.hpp.

References pion::net::HTTPWriter::setLogger().

Referenced by create().

pion::net::HTTPRequestWriter::HTTPRequestWriter ( TCPConnectionPtr &  tcp_conn,
HTTPRequestPtr &  http_request,
FinishedHandler  handler 
) [inline, protected]

protected constructor restricts creation of objects (use create())

Parameters:
tcp_connTCP connection used to send the request
http_requestpointer to the request that will be sent
handlerfunction 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().


Member Function Documentation

static boost::shared_ptr<HTTPRequestWriter> pion::net::HTTPRequestWriter::create ( TCPConnectionPtr &  tcp_conn,
FinishedHandler  handler = FinishedHandler() 
) [inline, static]

creates new HTTPRequestWriter objects

Parameters:
tcp_connTCP connection used to send the request
handlerfunction called after the request has been sent
Returns:
boost::shared_ptr<HTTPRequestWriter> shared pointer to the new writer object that was created

Definition at line 47 of file HTTPRequestWriter.hpp.

References HTTPRequestWriter().

static boost::shared_ptr<HTTPRequestWriter> pion::net::HTTPRequestWriter::create ( TCPConnectionPtr &  tcp_conn,
HTTPRequestPtr &  http_request,
FinishedHandler  handler = FinishedHandler() 
) [inline, static]

creates new HTTPRequestWriter objects

Parameters:
tcp_connTCP connection used to send the request
http_requestpointer to the request that will be sent
handlerfunction called after the request has been sent
Returns:
boost::shared_ptr<HTTPRequestWriter> shared pointer to the new writer object that was created

Definition at line 63 of file HTTPRequestWriter.hpp.

References HTTPRequestWriter().

virtual void pion::net::HTTPRequestWriter::handleWrite ( const boost::system::error_code &  write_error,
std::size_t  bytes_written 
) [inline, protected, virtual]

called after the request is sent

Parameters:
write_errorerror status from the last write operation
bytes_writtennumber 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().

virtual void pion::net::HTTPRequestWriter::prepareBuffersForSend ( HTTPMessage::WriteBuffers write_buffers) [inline, protected, virtual]

initializes a vector of write buffers with the HTTP message information

Parameters:
write_buffersvector 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().


The documentation for this class was generated from the following file: