add http client and channel reordering (waste of time)

This commit is contained in:
ouwou
2020-08-19 21:08:57 -04:00
parent 0cd0260f2e
commit 4b903bbd3e
11 changed files with 279 additions and 48 deletions

View File

@@ -35,10 +35,10 @@ void Websocket::Send(const nlohmann::json &j) {
void Websocket::OnMessage(const ix::WebSocketMessagePtr &msg) {
switch (msg->type) {
case ix::WebSocketMessageType::Message: {
if (msg->str.size() > 1000)
printf("%s\n", msg->str.substr(0, 1000).c_str());
else
printf("%s\n", msg->str.c_str());
//if (msg->str.size() > 1000)
// printf("%s\n", msg->str.substr(0, 1000).c_str());
//else
// printf("%s\n", msg->str.c_str());
auto obj = nlohmann::json::parse(msg->str);
if (m_json_callback)
m_json_callback(obj);