-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHttpServer
More file actions
69 lines (53 loc) · 1.3 KB
/
HttpServer
File metadata and controls
69 lines (53 loc) · 1.3 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* Copyright (C) 2021 Frank Mertens.
*
* Distribution and use is allowed under the terms of the GNU General Public License version 3
* (see CoreComponents/LICENSE-gpl-3.0).
*
*/
#pragma once
#include <cc/HttpServerConfig>
#include <cc/Signal>
#include <cc/Channel>
namespace cc {
/** \class HttpServer cc/HttpServer
* \ingroup http_server
* \brief HTTP(s) web server
*/
class HttpServer final: public Object
{
public:
/** Create a new HTTP server
* \param config %Node configuration
*/
explicit HttpServer(const String &config);
/** Create a new HTTP server
* \param config %Node configuration
*/
explicit HttpServer(const HttpServerConfig &config);
/** Start the server
*/
void start();
/** Wait until the server is up and running
*/
SocketAddress waitStarted();
/** Wait for server shutdown
*/
void wait();
/** Request server shutdown
*/
void shutdown();
/** Communicate signals caught to the HTTP server
*/
Channel<Signal> &signals();
/** Exit code which can be used on process termination
*/
int exitCode() const;
private:
friend class HttpServerConfig;
struct State;
static void loadPlugins();
State &me();
const State &me() const;
};
} // namespace cc