-
Notifications
You must be signed in to change notification settings - Fork 373
/
Copy pathWebMain.h
44 lines (35 loc) · 870 Bytes
/
WebMain.h
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
// This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2008 Emweb bv, Herent, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef WT_WEB_MAIN_H_
#define WT_WEB_MAIN_H_
#include "Wt/WServer.h"
namespace Wt {
class WebStream;
/*
* This controls a main loop for connectors which are not
* event-driven. It reads incoming requests from a webstream, and
* schedules the handling of them into a thread pool.
*
* It also deal with event scheduling.
*/
class WT_API WebMain
{
public:
WebMain(WServer *server, WebStream *stream,
std::string singleSessionId = std::string());
~WebMain();
WebController& controller() { return *server_->controller(); }
void run();
void shutdown();
private:
WServer *server_;
WebStream *stream_;
std::string singleSessionId_;
bool shutdown_;
};
}
#endif // WEB_MAIN_H_