Added timeout handling for keep-alive operations.
This commit is contained in:
@@ -52,11 +52,15 @@ class Connection : public std::enable_shared_from_this<Connection>
|
||||
/// Handle completion of a write operation.
|
||||
void handle_write(const boost::system::error_code &e);
|
||||
|
||||
/// Handle read timeout
|
||||
void handle_timeout();
|
||||
|
||||
std::vector<char> compress_buffers(const std::vector<char> &uncompressed_data,
|
||||
const http::compression_type compression_type);
|
||||
|
||||
boost::asio::io_service::strand strand;
|
||||
boost::asio::ip::tcp::socket TCP_socket;
|
||||
boost::asio::deadline_timer timer;
|
||||
RequestHandler &request_handler;
|
||||
RequestParser request_parser;
|
||||
boost::array<char, 8192> incoming_data_buffer;
|
||||
@@ -68,6 +72,7 @@ class Connection : public std::enable_shared_from_this<Connection>
|
||||
//Keep alive support
|
||||
bool keep_alive = false;
|
||||
short processed_requests = 512;
|
||||
short keepalive_timeout = 5; // In seconds
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user