# pion::http::reader Class Reference

`#include <reader.hpp>`

Inherits pion::http::parser.

Inherited by pion::http::request_reader, and pion::http::response_reader.

List of all members.

## Public Member Functions

void | receive (void)
| Incrementally reads & parses the HTTP message.
tcp::connection_ptr & | get_connection (void)
| returns a shared pointer to the TCP connection
void | set_timeout (boost::uint32_t seconds)
| sets the maximum number of seconds for read operations

## Protected Member Functions

| reader (const bool is_request, tcp::connection_ptr &tcp_conn)
void | consume_bytes (const boost::system::error_code &read_error, std::size_t bytes_read)
void | consume_bytes (void)
| Consumes bytes that have been read using an HTTP parser.
virtual void | read_bytes (void)=0
| Reads more bytes from the TCP connection.
virtual void | finished_reading (const boost::system::error_code &ec)=0
| Called after we have finished reading/parsing the HTTP message.
virtual http::message & | get_message (void)=0
| Returns a reference to the HTTP message being parsed.

## Detailed Description

reader: asynchronously reads and parses HTTP messages

Definition at line 28 of file reader.hpp.

## Constructor & Destructor Documentation

pion::http::reader::reader | ( | const bool | is_request,
|  | tcp::connection_ptr & | tcp_conn |
| ) |  |  | `[inline, protected]`

protected constructor: only derived classes may create objects

Parameters:

  | is_request | if true, the message is parsed as an HTTP request; if false, the message is parsed as an HTTP response
  | tcp_conn | TCP connection containing a new message to parse

Definition at line 55 of file reader.hpp.

## Member Function Documentation

void pion::http::reader::consume_bytes | ( | 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_error | error status from the last read operation
  | bytes_read | number of bytes consumed by the last read operation

Definition at line 41 of file http_reader.cpp.

References consume_bytes(), pion::http::parser::is_parsing_request(), pion::http::parser::m_logger, and pion::http::parser::set_read_buffer().

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

- include/pion/http/reader.hpp
- src/http_reader.cpp