1
This commit is contained in:
parent
a61719966e
commit
ba2151d25c
@ -7,7 +7,6 @@ namespace a8
|
|||||||
class TcpClient;
|
class TcpClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct timer_list;
|
|
||||||
class Master
|
class Master
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <a8/a8.h>
|
#include <a8/a8.h>
|
||||||
#include <f8/f8.h>
|
#include <f8/f8.h>
|
||||||
|
#include <f8/timer.h>
|
||||||
|
|
||||||
#include "constant.h"
|
#include "constant.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
@ -34,15 +34,15 @@ void UpStream::Init(int instance_id, const std::string& remote_ip, int remote_po
|
|||||||
tcp_client_->on_connect = std::bind(&UpStream::on_connect, this, std::placeholders::_1);
|
tcp_client_->on_connect = std::bind(&UpStream::on_connect, this, std::placeholders::_1);
|
||||||
tcp_client_->on_disconnect = std::bind(&UpStream::on_disconnect, this, std::placeholders::_1);
|
tcp_client_->on_disconnect = std::bind(&UpStream::on_disconnect, this, std::placeholders::_1);
|
||||||
tcp_client_->on_socketread = std::bind(&UpStream::on_socketread, this ,std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
|
tcp_client_->on_socketread = std::bind(&UpStream::on_socketread, this ,std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
|
||||||
#if 0
|
timer_wp_ = f8::Timer::Instance()->SetIntervalWpEx
|
||||||
timer_ = a8::Timer::Instance()->AddRepeatTimer(1000 * 9 + a8::RandEx(500, 150),
|
(1000 * 9 + a8::RandEx(500, 150),
|
||||||
a8::XParams().SetSender(this),
|
[this] (int event, const a8::Args* args)
|
||||||
[] (const a8::XParams& param)
|
{
|
||||||
{
|
if (a8::TIMER_EXEC_EVENT == event) {
|
||||||
UpStream* conn = (UpStream*)param.sender.GetUserData();
|
CheckAlive();
|
||||||
conn->CheckAlive();
|
}
|
||||||
});
|
},
|
||||||
#endif
|
&attacher_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpStream::UnInit()
|
void UpStream::UnInit()
|
||||||
|
@ -17,7 +17,6 @@ struct UpStreamMsgNode
|
|||||||
UpStreamMsgNode* next_node = nullptr;
|
UpStreamMsgNode* next_node = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct timer_list;
|
|
||||||
class UpStream
|
class UpStream
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -68,7 +67,8 @@ class UpStream
|
|||||||
char *recv_buff_ = nullptr;
|
char *recv_buff_ = nullptr;
|
||||||
unsigned int recv_bufflen_ = 0;
|
unsigned int recv_bufflen_ = 0;
|
||||||
std::shared_ptr<a8::TcpClient> tcp_client_;
|
std::shared_ptr<a8::TcpClient> tcp_client_;
|
||||||
timer_list* timer_ = nullptr;
|
f8::TimerWp timer_wp_;
|
||||||
|
f8::Attacher attacher_;
|
||||||
|
|
||||||
UpStreamMsgNode* top_node_ = nullptr;
|
UpStreamMsgNode* top_node_ = nullptr;
|
||||||
UpStreamMsgNode* bot_node_ = nullptr;
|
UpStreamMsgNode* bot_node_ = nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user