/// @brief Constructor.
HttpCommandMgrImpl()
- : io_service_(), timeout_(TIMEOUT_DHCP_SERVER_RECEIVE_COMMAND),
+ : io_service_(), timeout_(TIMEOUT_AGENT_RECEIVE_COMMAND),
+ idle_timeout_(TIMEOUT_AGENT_IDLE_CONNECTION_TIMEOUT),
current_config_(), http_listeners_(), active_(0) {
}
/// @brief Connection timeout.
long timeout_;
+ /// @brief Idle connection timeout.
+ long idle_timeout_;
+
/// @brief Current config.
HttpCommandConfigPtr current_config_;
server_port,
tls_context,
rfc,
- HttpListener::RequestTimeout(TIMEOUT_AGENT_RECEIVE_COMMAND),
- HttpListener::IdleTimeout(TIMEOUT_AGENT_IDLE_CONNECTION_TIMEOUT)));
+ HttpListener::RequestTimeout(timeout_),
+ HttpListener::IdleTimeout(idle_timeout_)));
// Instruct the HTTP listener to actually open socket, install
// callback and start listening.
http_listener->start();
impl_->timeout_ = timeout;
}
+void
+HttpCommandMgr::setIdleConnectionTimeout(const long timeout) {
+ impl_->idle_timeout_ = timeout;
+}
+
void
HttpCommandMgr::configure(HttpCommandConfigPtr config) {
impl_->configure(config);
/// @param timeout New connection timeout in milliseconds.
void setConnectionTimeout(const long timeout);
+ /// @brief Override default idle connection timeout.
+ ///
+ /// @param timeout New connection timeout in milliseconds.
+ void setIdleConnectionTimeout(const long timeout);
+
/// @brief Configure control socket from configuration.
///
/// @param config Configuration of the control socket.