Realistic 3D camera system
3D camera system components
server.hpp
Go to the documentation of this file.
1 //
2 // server.hpp
3 // ~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10 
11 #ifndef HTTP_SERVER_HPP
12 #define HTTP_SERVER_HPP
13 
14 #include <asio.hpp>
15 #include <string>
16 #include "connection.hpp"
17 #include "connection_manager.hpp"
18 #include "request_handler.hpp"
19 
20 namespace http {
21 namespace server {
22 
24 class server
25 {
26 public:
27  server(const server&) = delete;
28  server& operator=(const server&) = delete;
29 
32  explicit server(const std::string& address, const std::string& port,
33  const std::string& doc_root);
34 
36  void run();
37 
38 private:
40  void do_accept();
41 
43  void do_await_stop();
44 
46  asio::io_service io_service_;
47 
49  asio::signal_set signals_;
50 
52  asio::ip::tcp::acceptor acceptor_;
53 
55  connection_manager connection_manager_;
56 
58  asio::ip::tcp::socket socket_;
59 
61  request_handler request_handler_;
62 };
63 
64 } // namespace server
65 } // namespace http
66 
67 #endif // HTTP_SERVER_HPP
Provides core I/O functionality.
Definition: io_service.hpp:184
Provides stream-oriented socket functionality.
Provides signal functionality.
server(const std::string &address, const std::string &port, const std::string &doc_root)
Definition: server.cpp:18
Provides the ability to accept new connections.
server & operator=(const server &)=delete
void run()
Run the server&#39;s io_service loop.
Definition: server.cpp:49