只能有一个令牌客户端实例

This commit is contained in:
大石头 2017-01-09 12:54:49 +08:00
parent e5392700a4
commit 82a799c79f
2 changed files with 23 additions and 16 deletions

View File

@ -17,6 +17,8 @@
#include "Security\RC4.h"
TokenClient* TokenClient::Current = nullptr;
static void BroadcastHelloTask(void* param);
TokenClient::TokenClient()
@ -42,6 +44,9 @@ TokenClient::TokenClient()
NextReport = 0;
ReportLength = 0;
assert(!Current, "只能有一个令牌客户端实例");
Current = this;
// 重启
//Register("Gateway/Restart", InvokeRestart, this);
// 重置

View File

@ -90,6 +90,8 @@ public:
Register(action, *(InvokeHandler*)&func, target);
}
static TokenClient* Current;
// 重启,重置
static bool InvokeRestart(void * param, const Pair& args, Stream& result);
static bool InvokeReset(void * param, const Pair& args, Stream& result);