mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-06-08 15:16:52 +02:00
[daemon] WIP: use callbacks to work with daemon
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
463d43b0bb
commit
78193fc8f8
4 changed files with 30 additions and 8 deletions
|
@ -69,6 +69,11 @@ namespace http
|
|||
void Start ();
|
||||
void Stop ();
|
||||
|
||||
typedef std::function<void ()> DaemonStop;
|
||||
typedef int DaemonGracefulTimer;
|
||||
void SetDaemonStop (const DaemonStop& f) { m_DaemonStop = f; };
|
||||
void SetDaemonGracefulTimer (const DaemonGracefulTimer& f) { m_DaemonGracefulTimer = f; };
|
||||
|
||||
private:
|
||||
|
||||
void Run ();
|
||||
|
@ -85,6 +90,11 @@ namespace http
|
|||
boost::asio::io_service::work m_Work;
|
||||
boost::asio::ip::tcp::acceptor m_Acceptor;
|
||||
std::string m_Hostname;
|
||||
|
||||
private:
|
||||
|
||||
DaemonStop m_DaemonStop;
|
||||
DaemonGracefulTimer m_DaemonGracefulTimer;
|
||||
};
|
||||
|
||||
//all the below functions are also used by Qt GUI, see mainwindow.cpp -> getStatusPageHtml
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue