summaryrefslogtreecommitdiff
path: root/src/proxy.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@yahoo.com>2017-02-28 21:50:44 +0100
committerJoel Klinghed <the_jk@yahoo.com>2017-02-28 21:50:44 +0100
commitc029d90d1975e124d237605f1edb2be16bd05b5d (patch)
tree9df87ffb365354bdb74a969440b32c8304bdbcb7 /src/proxy.hh
Initial commit
Diffstat (limited to 'src/proxy.hh')
-rw-r--r--src/proxy.hh37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/proxy.hh b/src/proxy.hh
new file mode 100644
index 0000000..6545152
--- /dev/null
+++ b/src/proxy.hh
@@ -0,0 +1,37 @@
+// -*- mode: c++; c-basic-offset: 2; -*-
+
+#ifndef PROXY_HH
+#define PROXY_HH
+
+#include <string>
+
+class Config;
+class Logger;
+
+class Proxy {
+public:
+ virtual ~Proxy() {}
+
+ static Proxy* create(Config* config, std::string const& cwd,
+ char const* configfile,
+ char const* logfile,
+ Logger* logger,
+ int accept_fd, int monitor_fd);
+ static int setup_accept_socket(Config* config, Logger* logger);
+ static int setup_monitor_socket(Config* config, Logger* logger);
+
+ // Called from signal handler, ask the proxy to exit as soon as possible
+ virtual void quit() = 0;
+
+ // Called from signal handler, ask the proxy to reload config as soon
+ // as possible
+ virtual void reload() = 0;
+
+ virtual bool run() = 0;
+
+protected:
+ Proxy() {}
+ Proxy(Proxy const&) = delete;
+};
+
+#endif // PROXY_HH