aboutsummaryrefslogtreecommitdiff
path: root/zenhttp/httpasio.h
blob: 7161459551b0d759974f50aa587769e0b6893307 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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 int	 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