Merge pull request #148 from tantongchao/master

处理压测连接数大于服务最大连接数,并且有连接频繁建立、断开时,TC_EpollServer::ConnectionList::getUniqId()中出现assert错误
This commit is contained in:
ruanshudong 2021-03-23 22:02:59 +08:00 committed by GitHub
commit c87fa9e301
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1662,8 +1662,6 @@ void TC_EpollServer::NetThread::delConnection(TC_EpollServer::Connection *cPtr,
cPtr->getBindAdapter()->insertRecvQueue(recv);
}
cPtr->getBindAdapter()->decreaseNowConnection();
//从epoller删除句柄放在close之前, 否则重用socket时会有问题
_epoller.del(cPtr->getfd(), uid, 0);
@ -1674,6 +1672,8 @@ void TC_EpollServer::NetThread::delConnection(TC_EpollServer::Connection *cPtr,
{
_list.del(uid);
}
cPtr->getBindAdapter()->decreaseNowConnection();
}
}