feat: 3.9.5.81 基础收发功能
This commit is contained in:
1 parent
66ea9d5428
commit
5a9f91b425
38 files changed
+21363
-28
No files matched your search
@@ -0,0 +1,37 @@
|
||||
#include "pch.h"
|
||||
#include "global_context.h"
|
||||
#include "thread_pool.h"
|
||||
|
||||
namespace wxhelper {
|
||||
|
||||
GlobalContext::~GlobalContext() {
|
||||
if (config.has_value()) {
|
||||
config.reset();
|
||||
}
|
||||
if (log.has_value()) {
|
||||
log.reset();
|
||||
}
|
||||
|
||||
}
|
||||
void GlobalContext::initialize(HMODULE module) {
|
||||
state =GlobalContextState::INITIALIZING;
|
||||
module_ = module;
|
||||
// Utils::Hide(module);
|
||||
UINT64 base = Utils::GetWeChatWinBase();
|
||||
config.emplace();
|
||||
config->Initialize();
|
||||
log.emplace();
|
||||
log->Initialize();
|
||||
http_server = std::unique_ptr<HttpServer>( new HttpServer(config->GetPort()));
|
||||
http_server->HttpStart();
|
||||
ThreadPool::GetInstance().Create(2, 8);
|
||||
mgr = std::unique_ptr<Manager>(new Manager(base));
|
||||
state =GlobalContextState::INITIALIZED;
|
||||
}
|
||||
|
||||
void GlobalContext::finally() {
|
||||
if (http_server) {
|
||||
http_server->HttpClose();
|
||||
}
|
||||
}
|
||||
} // namespace wxhelper
|
||||
Reference in new issue
Block a user