From c029d90d1975e124d237605f1edb2be16bd05b5d Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Tue, 28 Feb 2017 21:50:44 +0100 Subject: Initial commit --- src/proxy.hh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/proxy.hh (limited to 'src/proxy.hh') 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 + +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 -- cgit v1.2.3-70-g09d2