diff options
| author | Stefan Boberg <[email protected]> | 2021-10-14 19:07:14 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-14 19:07:14 +0200 |
| commit | 2b71d6a8d57c773bc7734b253a1ffd1e47162184 (patch) | |
| tree | c0c70f9f2f8b9dc895080aac9f7de1140c56ebf0 /zenhttp/httpasio.h | |
| parent | Merge branch 'main' of https://github.com/EpicGames/zen (diff) | |
| download | zen-2b71d6a8d57c773bc7734b253a1ffd1e47162184.tar.xz zen-2b71d6a8d57c773bc7734b253a1ffd1e47162184.zip | |
asio HTTP implementation (#23)
asio-based HTTP implementation
Diffstat (limited to 'zenhttp/httpasio.h')
| -rw-r--r-- | zenhttp/httpasio.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/zenhttp/httpasio.h b/zenhttp/httpasio.h new file mode 100644 index 000000000..08834ba21 --- /dev/null +++ b/zenhttp/httpasio.h @@ -0,0 +1,36 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include <zencore/thread.h> +#include <zenhttp/httpserver.h> + +#include <memory> + +namespace zen { + +namespace asio_http { + struct HttpServerConnection; + struct HttpAcceptor; + struct HttpAsioServerImpl; +} // namespace asio_http + +class HttpAsioServer : public HttpServer +{ +public: + HttpAsioServer(); + ~HttpAsioServer(); + + virtual void RegisterService(HttpService& Service) override; + virtual void Initialize(int BasePort) override; + virtual void Run(bool IsInteractiveSession) override; + virtual void RequestExit() override; + +private: + Event m_ShutdownEvent; + int m_BasePort = 0; + + std::unique_ptr<asio_http::HttpAsioServerImpl> m_Impl; +}; + +} // namespace zen |