fix getConnStatus bug that return all connections on all listen ports

This commit is contained in:
ruanshudong 2022-08-08 09:52:51 +08:00
parent b905a633ff
commit 0693d46f19

View File

@ -1269,7 +1269,7 @@ vector<TC_EpollServer::ConnStatus> TC_EpollServer::ConnectionList::getConnStatus
for(size_t i = 1; i <= _total; i++)
{
//是当前监听端口的连接
if(_vConn[i].first != NULL && _vConn[i].first->isTcp()) //getListenfd() == lfd)
if(_vConn[i].first != NULL && _vConn[i].first->isTcp() && _vConn[i].first->getBindAdapter()->getSocket().getfd() == lfd) //getListenfd() == lfd)
{
ConnStatus cs;