[daemon] WIP: use callbacks to work with daemon

Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
R4SAS 2022-06-08 19:35:23 +03:00
parent 463d43b0bb
commit 78193fc8f8
No known key found for this signature in database
GPG key ID: 66F6C87B98EBCFE2
4 changed files with 30 additions and 8 deletions

View file

@ -423,6 +423,10 @@ namespace util
try
{
d.httpServer = std::unique_ptr<i2p::http::HTTPServer>(new i2p::http::HTTPServer(httpAddr, httpPort));
d.httpServer->SetDaemonStop (std::bind (Daemon_Singleton::stop, this));
#if ((!defined(WIN32) && !defined(QT_GUI_LIB) && !defined(ANDROID)) || defined(ANDROID_BINARY))
d.httpServer->SetDaemonGracefulTimer (std::bind (Daemon_Singleton::stop, this));
#endif
d.httpServer->Start();
}
catch (std::exception& ex)