This commit is contained in:
aozhiwei 2023-11-24 12:02:29 +08:00
parent 7daf6dd6b9
commit f2f6d20e8a
3 changed files with 29 additions and 10 deletions

View File

@ -123,8 +123,9 @@ static void SavePerfLog()
f8::HttpClientPool::Instance()->max_user_request_delay = 0; f8::HttpClientPool::Instance()->max_user_request_delay = 0;
} }
bool App::Init(int argc, char* argv[]) void App::Init()
{ {
#if 0
signal(SIGPIPE, SIG_IGN); signal(SIGPIPE, SIG_IGN);
this->argc_ = argc; this->argc_ = argc;
this->argv_ = argv; this->argv_ = argv;
@ -227,6 +228,7 @@ bool App::Init(int argc, char* argv[])
); );
} }
return true; return true;
#endif
} }
void App::UnInit() void App::UnInit()
@ -598,3 +600,18 @@ int App::GetVersion()
} }
return *version_; return *version_;
} }
const std::string App::GetPkgName()
{
}
void App::Update()
{
}
void App::DispatchSocketMsg(f8::MsgHdr* hdr)
{
}

View File

@ -4,9 +4,10 @@
#include <a8/singleton.h> #include <a8/singleton.h>
#include <f8/protoutils.h> #include <f8/protoutils.h>
#include <f8/app.h>
struct MsgNode; struct MsgNode;
class App : public a8::Singleton<App> class App : public f8::UserApp, public a8::Singleton<App>
{ {
private: private:
App() {}; App() {};
@ -17,8 +18,11 @@ public:
std::map<int, int> debug_params; std::map<int, int> debug_params;
#endif #endif
bool Init(int argc, char* argv[]); virtual const std::string GetPkgName() override;
void UnInit(); virtual void Init() override;
virtual void UnInit() override;
virtual void Update() override;
virtual void DispatchSocketMsg(f8::MsgHdr* hdr) override;
int Run(); int Run();

View File

@ -1,12 +1,10 @@
#include "precompile.h" #include "precompile.h"
#include <f8/app.h>
#include "app.h" #include "app.h"
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
int exitcode = 0; return f8::App::Instance()->Run(argc, argv, App::Instance());
if (App::Instance()->Init(argc, argv)) {
exitcode = App::Instance()->Run();
App::Instance()->UnInit();
}
return exitcode;
} }