1 | #ifndef _HTTP_SERVER_H
|
---|
2 | #define _HTTP_SERVER_H
|
---|
3 |
|
---|
4 | #include "http_connection.h"
|
---|
5 | #include "connection_manager.h"
|
---|
6 |
|
---|
7 |
|
---|
8 | namespace http_server
|
---|
9 | {
|
---|
10 |
|
---|
11 | class cHttpServer : private boost::noncopyable
|
---|
12 | {
|
---|
13 | public:
|
---|
14 | cHttpServer(unsigned int port);
|
---|
15 | ~cHttpServer();
|
---|
16 |
|
---|
17 | void Start();
|
---|
18 | void Stop();
|
---|
19 |
|
---|
20 | private:
|
---|
21 | void StartAccept();
|
---|
22 | void HandleConnection(connection_ptr new_connection, const boost::system::error_code& error);
|
---|
23 |
|
---|
24 | private:
|
---|
25 | boost::asio::io_service m_IOService;
|
---|
26 | boost::asio::ip::tcp::acceptor m_Acceptor;
|
---|
27 | cConnectionManager m_ConnectionManager;
|
---|
28 | boost::asio::signal_set m_Signals;
|
---|
29 |
|
---|
30 | };
|
---|
31 |
|
---|
32 | }
|
---|
33 |
|
---|
34 |
|
---|
35 | #endif
|
---|