![]() |
Kea
1.5.0
|
Accepts and handles a single HTTP connection. More...
#include <connection.h>
Inheritance diagram for isc::http::HttpConnection:Public Member Functions | |
| HttpConnection (asiolink::IOService &io_service, HttpAcceptor &acceptor, HttpConnectionPool &connection_pool, const HttpResponseCreatorPtr &response_creator, const HttpAcceptorCallback &callback, const long request_timeout, const long idle_timeout) | |
| Constructor. More... | |
| ~HttpConnection () | |
| Destructor. More... | |
| void | asyncAccept () |
| Asynchronously accepts new connection. More... | |
| void | close () |
| Closes the socket. More... | |
| void | doRead () |
| Starts asynchronous read from the socket. More... | |
Accepts and handles a single HTTP connection.
Definition at line 43 of file connection.h.
| isc::http::HttpConnection::HttpConnection | ( | asiolink::IOService & | io_service, |
| HttpAcceptor & | acceptor, | ||
| HttpConnectionPool & | connection_pool, | ||
| const HttpResponseCreatorPtr & | response_creator, | ||
| const HttpAcceptorCallback & | callback, | ||
| const long | request_timeout, | ||
| const long | idle_timeout | ||
| ) |
Constructor.
| io_service | IO service to be used by the connection. |
| acceptor | Reference to the TCP acceptor object used to listen for new HTTP connections. |
| connection_pool | Connection pool in which this connection is stored. |
| response_creator | Pointer to the response creator object used to create HTTP response from the HTTP request received. |
| callback | Callback invoked when new connection is accepted. |
| request_timeout | Configured timeout for a HTTP request. |
| idle_timeout | Timeout after which persistent HTTP connection is closed by the server. |
Definition at line 39 of file connection.cc.
| isc::http::HttpConnection::~HttpConnection | ( | ) |
Destructor.
Closes current connection.
Definition at line 61 of file connection.cc.
References close().
Here is the call graph for this function:| void isc::http::HttpConnection::asyncAccept | ( | ) |
Asynchronously accepts new connection.
When the connection is established successfully, the timeout timer is setup and the asynchronous read from the socket is started.
Definition at line 84 of file connection.cc.
References isc::asiolink::TCPAcceptor< C >::asyncAccept(), isc_throw, and isc::Exception::what().
Here is the call graph for this function:| void isc::http::HttpConnection::close | ( | ) |
Closes the socket.
Definition at line 66 of file connection.cc.
References isc::asiolink::IntervalTimer::cancel(), and isc::asiolink::TCPSocket< C >::close().
Referenced by ~HttpConnection().
Here is the call graph for this function:| void isc::http::HttpConnection::doRead | ( | ) |
Starts asynchronous read from the socket.
The data received over the socket are supplied to the HTTP parser until the parser signals that the entire request has been received or until the parser signals an error. In the former case the server creates an HTTP response using supplied response creator object.
In case of error the connection is stopped.
Definition at line 101 of file connection.cc.
References isc::asiolink::TCPSocket< C >::asyncReceive().
Here is the call graph for this function: