1
This commit is contained in:
parent
5e891d67a7
commit
e4cc44cf80
@ -342,4 +342,13 @@ namespace a8
|
||||
abort();
|
||||
}
|
||||
|
||||
void TestSleep(int count, int interval, const std::string text)
|
||||
{
|
||||
int i = 0;
|
||||
while (i++ < count) {
|
||||
sleep(interval);
|
||||
}
|
||||
XPrintf("TestSleep %s\n", {text});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -97,4 +97,5 @@ namespace a8
|
||||
void ClearSendQueue(a8::SendQueueNode* node);
|
||||
|
||||
void Abort();
|
||||
void TestSleep(int count, int interval, const std::string text);
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ namespace a8
|
||||
ClearTimeOutSocket();
|
||||
a8::TcpSession* p = nullptr;
|
||||
if (top_node_) {
|
||||
if (time(nullptr) - top_node_->addtime >= 30) {
|
||||
if (time(nullptr) - top_node_->addtime >= 20) {
|
||||
p = top_node_->session;
|
||||
a8::TcpSessionPool::TcpSessionNode* pdelnode = top_node_;
|
||||
top_node_ = top_node_->next;
|
||||
@ -68,12 +68,13 @@ namespace a8
|
||||
void TcpSessionPool::ClearTimeOutSocket()
|
||||
{
|
||||
while (top_node_) {
|
||||
if(time(nullptr) - top_node_->addtime > 60 * 5){
|
||||
if(time(nullptr) - top_node_->addtime > 30){
|
||||
a8::TcpSessionPool::TcpSessionNode* pdelnode = top_node_;
|
||||
top_node_ = top_node_->next;
|
||||
if (!top_node_) {
|
||||
bot_node_ = NULL;
|
||||
}
|
||||
pdelnode->session->Destory();
|
||||
delete pdelnode->session;
|
||||
delete pdelnode;
|
||||
count_--;
|
||||
|
Loading…
x
Reference in New Issue
Block a user