diff options
Diffstat (limited to 'zencore/httpsys.h')
| -rw-r--r-- | zencore/httpsys.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/zencore/httpsys.h b/zencore/httpsys.h index 8a7b372dd..7c0543e45 100644 --- a/zencore/httpsys.h +++ b/zencore/httpsys.h @@ -13,25 +13,28 @@ namespace zen { /** * @brief Windows implementation of HTTP server based on http.sys - * + * * This requires elevation to function */ -class HttpSysServer +class HttpSysServer : public HttpServer { friend class HttpSysTransaction; public: - HttpSysServer(WinIoThreadPool& InThreadPool); + explicit HttpSysServer(int ThreadCount); ~HttpSysServer(); - void Initialize(const wchar_t* UrlPath); - void Run(bool TestMode); + // HttpServer interface implementation - void RequestExit() { m_ShutdownEvent.Set(); } + virtual void Initialize(int BasePort) override; + virtual void Run(bool TestMode) override; + virtual void RequestExit() override; + virtual void AddEndpoint(HttpService& Service) override; - void StartServer(); - void StopServer(); +private: + void Initialize(const wchar_t* UrlPath); + void StartServer(); void OnHandlingRequest(); void IssueNewRequestMaybe(); @@ -41,18 +44,18 @@ public: void RemoveEndpoint(const char* Endpoint, HttpService& Service); private: - bool m_IsOk = false; - bool m_IsHttpInitialized = false; - WinIoThreadPool& m_ThreadPool; + bool m_IsOk = false; + bool m_IsHttpInitialized = false; + WinIoThreadPool m_ThreadPool; std::wstring m_BaseUri; // http://*:nnnn/ HTTP_SERVER_SESSION_ID m_HttpSessionId = 0; HTTP_URL_GROUP_ID m_HttpUrlGroupId = 0; HANDLE m_RequestQueueHandle = 0; std::atomic_int32_t m_PendingRequests{0}; - int32_t m_MinPendingRequests = 4; - int32_t m_MaxPendingRequests = 32; + int32_t m_MinPendingRequests = 16; + int32_t m_MaxPendingRequests = 128; Event m_ShutdownEvent; }; -} +} // namespace zen |