# AsyncHttpConnectionHandler.hpp
This File On Github
Ask A Question
API: latest
module: oatpp
#include "oatpp/web/server/AsyncHttpConnectionHandler.hpp"
# AsyncHttpConnectionHandler
Asynchronous oatpp::network::ConnectionHandler for handling http communication.
namespace oatpp { namespace web { namespace server {
class AsyncHttpConnectionHandler : public base::Countable, public network::ConnectionHandler, public HttpProcessor::TaskProcessingListener {}
}}}
# Methods
Return Type | Name | Summary |
---|---|---|
[none] | AsyncHttpConnectionHandler | Multiple implementations:
|
void | addRequestInterceptor | Add request interceptor. Request interceptors are called before routing happens. |
void | addResponseInterceptor | Add response interceptor. |
void | stop | Will call m_executor.stop() |
v_uint64 | getConnectionsCount | Get connections count. |
# AsyncHttpConnectionHandler::AsyncHttpConnectionHandler
- Constructor.
- @param components - oatpp::web::server::HttpProcessor::Components.
- @param threadCount - number of threads.
AsyncHttpConnectionHandler(const std::shared_ptr<HttpProcessor::Components>& components, v_int32 threadCount = oatpp::async::Executor::VALUE_SUGGESTED)
- Constructor.
- @param components - oatpp::web::server::HttpProcessor::Components.
- @param executor - oatpp::async::Executor.
AsyncHttpConnectionHandler(const std::shared_ptr<HttpProcessor::Components>& components, const std::shared_ptr<oatpp::async::Executor>& executor)
- Constructor.
- @param router - oatpp::web::server::HttpRouter to route incoming requests.
- @param threadCount - number of threads.
AsyncHttpConnectionHandler(const std::shared_ptr<HttpRouter>& router, v_int32 threadCount = oatpp::async::Executor::VALUE_SUGGESTED) : AsyncHttpConnectionHandler(std::make_shared<HttpProcessor::Components>(router), threadCount)
- Constructor.
- @param router - oatpp::web::server::HttpRouter to route incoming requests.
- @param executor - oatpp::async::Executor.
AsyncHttpConnectionHandler(const std::shared_ptr<HttpRouter>& router, const std::shared_ptr<oatpp::async::Executor>& executor) : AsyncHttpConnectionHandler(std::make_shared<HttpProcessor::Components>(router), executor)
- Constructor.
- @param router - oatpp::web::server::HttpRouter to route incoming requests.
- @param config - oatpp::web::server::HttpProcessor::Config.
- @param threadCount - number of threads.
AsyncHttpConnectionHandler(const std::shared_ptr<HttpRouter>& router, const std::shared_ptr<HttpProcessor::Config>& config, v_int32 threadCount = oatpp::async::Executor::VALUE_SUGGESTED) : AsyncHttpConnectionHandler(std::make_shared<HttpProcessor::Components>(router, config), threadCount)
- Constructor.
- @param router - oatpp::web::server::HttpRouter to route incoming requests.
- @param config - oatpp::web::server::HttpProcessor::Config.
- @param executor - oatpp::async::Executor.
AsyncHttpConnectionHandler(const std::shared_ptr<HttpRouter>& router, const std::shared_ptr<HttpProcessor::Config>& config, const std::shared_ptr<oatpp::async::Executor>& executor) : AsyncHttpConnectionHandler(std::make_shared<HttpProcessor::Components>(router, config), executor)
# AsyncHttpConnectionHandler::addRequestInterceptor
Add request interceptor. Request interceptors are called before routing happens. If multiple interceptors set then the order of interception is the same as the order of calls to addRequestInterceptor
.
- @param interceptor - oatpp::web::server::interceptor::RequestInterceptor.
void addRequestInterceptor(const std::shared_ptr<interceptor::RequestInterceptor>& interceptor)
# AsyncHttpConnectionHandler::addResponseInterceptor
Add response interceptor. If multiple interceptors set then the order of interception is the same as the order of calls to addResponseInterceptor
.
- @param interceptor - oatpp::web::server::interceptor::RequestInterceptor.
void addResponseInterceptor(const std::shared_ptr<interceptor::ResponseInterceptor>& interceptor)
# AsyncHttpConnectionHandler::stop
Will call m_executor.stop()
void stop() override
# AsyncHttpConnectionHandler::getConnectionsCount
Get connections count.
- @return
v_uint64 getConnectionsCount()