rikitiki  v0.1.67
Build C++ web server modules that allow easy routing and deployment.
server.h
1 /* Copyright (C) 2012-2013 Justin Berger
2  The full license is available in the LICENSE file at the root of this project and is also available at http://opensource.org/licenses/MIT. */
3 #pragma once
4 #include "../server.h"
5 #include "mongoose.h"
6 #ifdef _Win32
7 #include <Windows.h>
8 #define Sleep usleep
9 #else
10 #include <unistd.h>
11 #endif
12 
13 namespace rikitiki {
14  namespace mongoose {
18  class MongooseServer : public Server {
19  mg_context *ctx;
20  std::vector<const char*> options;
21 
22  int port;
23  public:
24  std::string DocumentRoot;
25  int Port() { return port; }
26  MongooseServer(int _port);
27 
31  void Run();
33  void Start();
35  void Stop();
36  };
37  }
38 }