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

#include <HTTPReader.hpp>

Inherits pion::net::HTTPParser.

Inherited by pion::net::HTTPRequestReader, and pion::net::HTTPResponseReader.

List of all members.

Public Member Functions

void receive (void)
 Incrementally reads & parses the HTTP message.
TCPConnectionPtr & getTCPConnection (void)
 returns a shared pointer to the TCP connection
void setTimeout (boost::uint32_t seconds)
 sets the maximum number of seconds for read operations

Protected Member Functions

 HTTPReader (const bool is_request, TCPConnectionPtr &tcp_conn)
void consumeBytes (const boost::system::error_code &read_error, std::size_t bytes_read)
void consumeBytes (void)
 Consumes bytes that have been read using an HTTP parser.
virtual void readBytes (void)=0
 Reads more bytes from the TCP connection.
virtual void finishedReading (const boost::system::error_code &ec)=0
 Called after we have finished reading/parsing the HTTP message.
virtual HTTPMessagegetMessage (void)=0
 Returns a reference to the HTTP message being parsed.

Detailed Description

HTTPReader: asynchronously reads and parses HTTP messages

Definition at line 28 of file HTTPReader.hpp.


Constructor & Destructor Documentation

pion::net::HTTPReader::HTTPReader ( const bool  is_request,
TCPConnectionPtr &  tcp_conn 
) [inline, protected]

protected constructor: only derived classes may create objects

Parameters:
is_requestif true, the message is parsed as an HTTP request; if false, the message is parsed as an HTTP response
tcp_connTCP connection containing a new message to parse

Definition at line 55 of file HTTPReader.hpp.


Member Function Documentation

void pion::net::HTTPReader::consumeBytes ( const boost::system::error_code &  read_error,
std::size_t  bytes_read 
) [protected]

Consumes bytes that have been read using an HTTP parser

Parameters:
read_errorerror status from the last read operation
bytes_readnumber of bytes consumed by the last read operation

Definition at line 41 of file HTTPReader.cpp.

References consumeBytes(), pion::net::HTTPParser::isParsingRequest(), pion::net::HTTPParser::m_logger, and pion::net::HTTPParser::setReadBuffer().


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