server.h
1 /*
2 * Nebula Atom
3 
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef ATOM_CORE_SERVER
19 #define ATOM_CORE_SERVER
20 
21 
22 #include <Poco/ThreadPool.h>
23 #include <map>
24 #include <exception>
25 #include <vector>
26 #include <memory>
27 #include <stdexcept>
28 
29 #include "Poco/Exception.h"
30 #include "Poco/Net/HTTPServer.h"
31 #include "Poco/Net/ServerSocket.h"
32 #include "Poco/Net/SecureServerSocket.h"
33 
34 #include "tools/output_logger.h"
35 #include "tools/settings_manager.h"
36 
37 using namespace Poco;
38 using namespace Poco::Net;
39 
40 namespace Atom
41 {
42  namespace Core
43  {
44  class Server;
45  }
46 }
47 
48 
49 class Atom::Core::Server : public Net::HTTPServer
50 {
51  public:
52  using Ptr = std::shared_ptr<Server>;
53 
54  Server(HTTPRequestHandlerFactory::Ptr factory, const ServerSocket& socket, HTTPServerParams::Ptr params);
55  Server(HTTPRequestHandlerFactory::Ptr factory, const SecureServerSocket& socket, HTTPServerParams::Ptr params);
56  virtual ~Server();
57 
58  protected:
59  void SetupParams_(HTTPServerParams::Ptr params);
60 
61  private:
62  std::string server_name_;
63 };
64 
65 #endif // ATOM_CORE_SERVER
Definition: server.h:50