I wonder if this is ever going to work
[theodwalha.git] / theodwalha / server.hpp
blob5dd21b1ca58df28898aebd44bebed1cde2f8e4c7
1 #pragma once
3 #include <ail/types.hpp>
4 #include <boost/asio.hpp>
5 #include <theodwalha/client.hpp>
6 #include <theodwalha/temporary.hpp>
7 #include <theodwalha/module_manager.hpp>
9 class http_server
11 public:
13 http_server(boost::asio::io_service & io_service, std::string const & temporary_file_directory);
15 bool launch_server(ushort new_port);
17 private:
19 bool running;
20 ushort port;
22 boost::asio::io_service & io_service;
23 boost::asio::ip::tcp::acceptor acceptor;
25 temporary_file_manager file_manager;
26 module_manager modules;
28 void accept();
30 void accept_event(boost::system::error_code const & error, http_server_client * new_client);