1
This commit is contained in:
parent
90b90c1d44
commit
d3ef1e5b83
@ -5,6 +5,7 @@
|
||||
#include <a8/tcplistener.h>
|
||||
|
||||
#include <f8/netmsghandler.h>
|
||||
#include <f8/msgqueue.h>
|
||||
|
||||
#include "app.h"
|
||||
#include "GGListener.h"
|
||||
@ -50,25 +51,29 @@ public:
|
||||
virtual void OnRawHttpGet(const std::string& url, const std::string& querystr,
|
||||
std::string& response) override
|
||||
{
|
||||
#if 0
|
||||
App::Instance()->AddIMMsg(IM_ExecGM,
|
||||
a8::XParams()
|
||||
.SetSender(socket_handle)
|
||||
.SetParam1(url)
|
||||
.SetParam2(querystr)
|
||||
.SetParam3(saddr)
|
||||
);
|
||||
#endif
|
||||
f8::MsgQueue::Instance()->PostMsg
|
||||
(IM_ExecGM,
|
||||
a8::Args
|
||||
(
|
||||
{
|
||||
socket_handle,
|
||||
a8::XValue(url).GetString(),
|
||||
a8::XValue(querystr).GetString(),
|
||||
saddr
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
virtual void OnDisConnect() override
|
||||
{
|
||||
#if 0
|
||||
App::Instance()->AddIMMsg(IM_ClientSocketDisconnect,
|
||||
a8::XParams()
|
||||
.SetSender(socket_handle)
|
||||
.SetParam1(1));
|
||||
#endif
|
||||
f8::MsgQueue::Instance()->PostMsg
|
||||
(IM_ClientSocketDisconnect,
|
||||
a8::Args
|
||||
(
|
||||
{
|
||||
socket_handle
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include <a8/mutable_xobject.h>
|
||||
#include <f8/jsonhttprequest.h>
|
||||
#include <f8/msgqueue.h>
|
||||
|
||||
#include "handlermgr.h"
|
||||
|
||||
@ -34,6 +35,24 @@ void HandlerMgr::Init()
|
||||
{
|
||||
GSMgr::Instance()->___GSList(request);
|
||||
});
|
||||
f8::MsgQueue::Instance()->RegisterCallBack
|
||||
(
|
||||
IM_ExecGM,
|
||||
[] (const a8::Args& args)
|
||||
{
|
||||
int socket_handle = args.Get<int>(0);
|
||||
std::string url = args.Get<std::string>(1);
|
||||
std::string query_str = args.Get<std::string>(2);
|
||||
unsigned long saddr = args.Get<unsigned long>(3);
|
||||
|
||||
HandlerMgr::Instance()->ProcGMMsg
|
||||
(
|
||||
saddr,
|
||||
socket_handle,
|
||||
url,
|
||||
query_str
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
void HandlerMgr::UnInit()
|
||||
|
Loading…
x
Reference in New Issue
Block a user