1
0

SocketThread: clients aren't double-removed anymore.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@909 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-09-29 19:43:34 +00:00
parent 6eee04b1f9
commit 70546f25a0
3 changed files with 4 additions and 23 deletions

View File

@@ -530,8 +530,6 @@ void cSocketThreads::cSocketThread::Execute(void)
}
WriteToSockets(&fdWrite);
RemoveClosedSockets();
} // while (!mShouldTerminate)
}
@@ -681,22 +679,3 @@ void cSocketThreads::cSocketThread::WriteToSockets(fd_set * a_Write)
void cSocketThreads::cSocketThread::RemoveClosedSockets(void)
{
// Removes sockets that have been queued for closing from m_Slots[]
cCSLock Lock(m_Parent->m_CS);
for (int i = m_NumSlots - 1; i >= 0; --i)
{
if (!m_Slots[i].m_ShouldClose || !m_Slots[i].m_Outgoing.empty())
{
continue;
}
m_Slots[i] = m_Slots[--m_NumSlots];
} // for i - m_Slots[]
}

View File

@@ -149,7 +149,6 @@ private:
void PrepareSet (fd_set * a_Set, cSocket::xSocket & a_Highest); // Puts all sockets into the set, along with m_ControlSocket1
void ReadFromSockets(fd_set * a_Read); // Reads from sockets indicated in a_Read
void WriteToSockets (fd_set * a_Write); // Writes to sockets indicated in a_Write
void RemoveClosedSockets(void); // Removes sockets that have closed from m_Slots[]
} ;
typedef std::list<cSocketThread *> cSocketThreadList;