An HTTP connection.
More...
|
| Connection (boost::asio::io_service &io_service, Handler *handler, const std::string &server_name, std::tuple< Middlewares... > *middlewares, std::function< std::string()> &get_cached_date_str_f, detail::task_timer &task_timer, typename Adaptor::context *adaptor_ctx_, std::atomic< unsigned int > &queue_length) |
|
| ~Connection () |
|
decltype(std::declval< Adaptor >().raw_socket()) & | socket () |
| The TCP socket on top of which the connection is established. More...
|
|
void | start () |
|
void | handle_header () |
|
void | handle () |
|
void | complete_request () |
| Call the after handle middleware and send the write the response to the connection. More...
|
|
template<typename Adaptor, typename Handler, typename... Middlewares>
class crow::Connection< Adaptor, Handler, Middlewares >
An HTTP connection.
◆ Connection()
template<typename Adaptor , typename Handler , typename... Middlewares>
crow::Connection< Adaptor, Handler, Middlewares >::Connection |
( |
boost::asio::io_service & |
io_service, |
|
|
Handler * |
handler, |
|
|
const std::string & |
server_name, |
|
|
std::tuple< Middlewares... > * |
middlewares, |
|
|
std::function< std::string()> & |
get_cached_date_str_f, |
|
|
detail::task_timer & |
task_timer, |
|
|
typename Adaptor::context * |
adaptor_ctx_, |
|
|
std::atomic< unsigned int > & |
queue_length |
|
) |
| |
|
inline |
◆ ~Connection()
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ socket()
template<typename Adaptor , typename Handler , typename... Middlewares>
decltype(std::declval<Adaptor>().raw_socket()) & crow::Connection< Adaptor, Handler, Middlewares >::socket |
( |
| ) |
|
|
inline |
The TCP socket on top of which the connection is established.
◆ start()
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ handle_header()
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ handle()
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ complete_request()
template<typename Adaptor , typename Handler , typename... Middlewares>
Call the after handle middleware and send the write the response to the connection.
◆ prepare_buffers()
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ do_write_static()
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ do_write_general()
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ do_read()
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ do_write()
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ do_write_sync()
template<typename Adaptor , typename Handler , typename... Middlewares>
void crow::Connection< Adaptor, Handler, Middlewares >::do_write_sync |
( |
std::vector< asio::const_buffer > & |
buffers | ) |
|
|
inlineprivate |
◆ check_destroy()
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ cancel_deadline_timer()
template<typename Adaptor , typename Handler , typename... Middlewares>
void crow::Connection< Adaptor, Handler, Middlewares >::cancel_deadline_timer |
( |
| ) |
|
|
inlineprivate |
◆ start_deadline()
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ crow::response
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ adaptor_
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ handler_
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ buffer_
template<typename Adaptor , typename Handler , typename... Middlewares>
boost::array<char, 4096> crow::Connection< Adaptor, Handler, Middlewares >::buffer_ |
|
private |
◆ parser_
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ req_
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ res
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ close_connection_
template<typename Adaptor , typename Handler , typename... Middlewares>
bool crow::Connection< Adaptor, Handler, Middlewares >::close_connection_ = false |
|
private |
◆ server_name_
template<typename Adaptor , typename Handler , typename... Middlewares>
const std::string& crow::Connection< Adaptor, Handler, Middlewares >::server_name_ |
|
private |
◆ buffers_
template<typename Adaptor , typename Handler , typename... Middlewares>
std::vector<boost::asio::const_buffer> crow::Connection< Adaptor, Handler, Middlewares >::buffers_ |
|
private |
◆ content_length_
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ date_str_
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ res_body_copy_
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ task_id_
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ is_reading
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ is_writing
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ need_to_call_after_handlers_
template<typename Adaptor , typename Handler , typename... Middlewares>
bool crow::Connection< Adaptor, Handler, Middlewares >::need_to_call_after_handlers_ {} |
|
private |
◆ need_to_start_read_after_complete_
template<typename Adaptor , typename Handler , typename... Middlewares>
bool crow::Connection< Adaptor, Handler, Middlewares >::need_to_start_read_after_complete_ {} |
|
private |
◆ add_keep_alive_
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ middlewares_
template<typename Adaptor , typename Handler , typename... Middlewares>
std::tuple<Middlewares...>* crow::Connection< Adaptor, Handler, Middlewares >::middlewares_ |
|
private |
◆ ctx_
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ get_cached_date_str
template<typename Adaptor , typename Handler , typename... Middlewares>
std::function<std::string()>& crow::Connection< Adaptor, Handler, Middlewares >::get_cached_date_str |
|
private |
◆ task_timer_
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ res_stream_threshold_
template<typename Adaptor , typename Handler , typename... Middlewares>
◆ queue_length_
template<typename Adaptor , typename Handler , typename... Middlewares>
std::atomic<unsigned int>& crow::Connection< Adaptor, Handler, Middlewares >::queue_length_ |
|
private |
The documentation for this class was generated from the following file: