summaryrefslogtreecommitdiff
path: root/includes/HttpServer.h
blob: 7ae0dc151b247936a07c83fcacce48690d56ff8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include <BString.h>
#include <Exceptions.h>

namespace Balau {

class HttpWorker;

class HttpServer {
  public:
      HttpServer() : m_started(false), m_listenerPtr(NULL), m_port(80) { }
      ~HttpServer() { if (!m_started) stop(); }
    void start();
    void stop();
    void setPort(int port) { Assert(!m_started); m_port = port; }
    void setLocal(const char * local) { Assert(!m_started); m_local = local; }
  private:
    bool m_started;
    void * m_listenerPtr;
    int m_port;
    String m_local;

    friend class HttpWorker;
};

};