1
This commit is contained in:
parent
ace8590f25
commit
f7125c874e
@ -87,20 +87,6 @@ namespace a8
|
|||||||
|
|
||||||
void AsioTcpClient::SetActive(bool active)
|
void AsioTcpClient::SetActive(bool active)
|
||||||
{
|
{
|
||||||
if (active) {
|
|
||||||
if (IsActive()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (worker_thread_) {
|
|
||||||
ActiveStop();
|
|
||||||
}
|
|
||||||
worker_thread_shutdown_ = false;
|
|
||||||
worker_thread_ = new std::thread(&AsioTcpClient::WorkerThreadProc, this);
|
|
||||||
} else {
|
|
||||||
if (worker_thread_) {
|
|
||||||
ActiveStop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AsioTcpClient::ActiveStart()
|
bool AsioTcpClient::ActiveStart()
|
||||||
@ -113,14 +99,6 @@ namespace a8
|
|||||||
connected_ = false;
|
connected_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsioTcpClient::WorkerThreadProc()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void AsioTcpClient::SenderThreadProc()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void AsioTcpClient::NotifySendCond()
|
void AsioTcpClient::NotifySendCond()
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lk(*send_cond_mutex_);
|
std::unique_lock<std::mutex> lk(*send_cond_mutex_);
|
||||||
|
@ -30,9 +30,6 @@ namespace a8
|
|||||||
std::shared_ptr<asio::ip::tcp::resolver> resolver_;
|
std::shared_ptr<asio::ip::tcp::resolver> resolver_;
|
||||||
std::shared_ptr<asio::ip::tcp::socket> socket_;
|
std::shared_ptr<asio::ip::tcp::socket> socket_;
|
||||||
volatile bool connected_ = false;
|
volatile bool connected_ = false;
|
||||||
volatile bool sender_thread_shutdown_ = false;
|
|
||||||
volatile bool worker_thread_shutdown_ = false;
|
|
||||||
std::thread* worker_thread_ = nullptr;
|
|
||||||
std::mutex* send_buffer_mutex_ = nullptr;
|
std::mutex* send_buffer_mutex_ = nullptr;
|
||||||
SendQueueNode *top_node_ = nullptr;
|
SendQueueNode *top_node_ = nullptr;
|
||||||
SendQueueNode *bot_node_ = nullptr;
|
SendQueueNode *bot_node_ = nullptr;
|
||||||
@ -42,8 +39,6 @@ namespace a8
|
|||||||
void SetActive(bool active);
|
void SetActive(bool active);
|
||||||
bool ActiveStart();
|
bool ActiveStart();
|
||||||
void ActiveStop();
|
void ActiveStop();
|
||||||
void WorkerThreadProc();
|
|
||||||
void SenderThreadProc();
|
|
||||||
void NotifySendCond();
|
void NotifySendCond();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user