1
This commit is contained in:
parent
ace8590f25
commit
f7125c874e
@ -87,20 +87,6 @@ namespace a8
|
||||
|
||||
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()
|
||||
@ -113,14 +99,6 @@ namespace a8
|
||||
connected_ = false;
|
||||
}
|
||||
|
||||
void AsioTcpClient::WorkerThreadProc()
|
||||
{
|
||||
}
|
||||
|
||||
void AsioTcpClient::SenderThreadProc()
|
||||
{
|
||||
}
|
||||
|
||||
void AsioTcpClient::NotifySendCond()
|
||||
{
|
||||
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::socket> socket_;
|
||||
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;
|
||||
SendQueueNode *top_node_ = nullptr;
|
||||
SendQueueNode *bot_node_ = nullptr;
|
||||
@ -42,8 +39,6 @@ namespace a8
|
||||
void SetActive(bool active);
|
||||
bool ActiveStart();
|
||||
void ActiveStop();
|
||||
void WorkerThreadProc();
|
||||
void SenderThreadProc();
|
||||
void NotifySendCond();
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user