aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/httpasio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenhttp/httpasio.cpp')
-rw-r--r--src/zenhttp/httpasio.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/zenhttp/httpasio.cpp b/src/zenhttp/httpasio.cpp
index e12125bcc..4d1f35c2b 100644
--- a/src/zenhttp/httpasio.cpp
+++ b/src/zenhttp/httpasio.cpp
@@ -1339,7 +1339,9 @@ HttpAsioServerImpl::RouteRequest(std::string_view Url)
//////////////////////////////////////////////////////////////////////////
namespace zen {
-HttpAsioServer::HttpAsioServer() : m_Impl(std::make_unique<asio_http::HttpAsioServerImpl>())
+HttpAsioServer::HttpAsioServer(unsigned int ThreadCount)
+: m_ThreadCount(ThreadCount != 0 ? ThreadCount : Max(std::thread::hardware_concurrency(), 8u))
+, m_Impl(std::make_unique<asio_http::HttpAsioServerImpl>())
{
ZEN_DEBUG("Request object size: {} ({:#x})", sizeof(asio_http::HttpRequest), sizeof(asio_http::HttpRequest));
}
@@ -1375,7 +1377,7 @@ HttpAsioServer::RegisterService(HttpService& Service)
int
HttpAsioServer::Initialize(int BasePort)
{
- m_BasePort = m_Impl->Start(gsl::narrow<uint16_t>(BasePort), Max(std::thread::hardware_concurrency(), 8u));
+ m_BasePort = m_Impl->Start(gsl::narrow<uint16_t>(BasePort), m_ThreadCount);
return m_BasePort;
}