First test version with network timeout. Only activity timeout and global timeout, no game admin timeout yet. Set to test values (will disconnect rapidly).
Modified method for init timeout (if session cannot be established) - now using one non-modifiable timer for each session, and an additional timer which is reset whenever session data is received.
This commit is contained in:
@@ -147,6 +147,8 @@ SessionManager::Select(unsigned timeoutMsec)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (retSession.sessionData.get())
|
||||
retSession.sessionData->ResetActivityTimer();
|
||||
return retSession;
|
||||
}
|
||||
|
||||
@@ -294,6 +296,24 @@ SessionManager::ForEach(boost::function<void (SessionWrapper)> func)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SessionManager::ForEachRemoveIf(boost::function<bool (SessionWrapper)> func)
|
||||
{
|
||||
boost::mutex::scoped_lock lock(m_sessionMapMutex);
|
||||
|
||||
SessionMap::iterator i = m_sessionMap.begin();
|
||||
SessionMap::iterator end = m_sessionMap.end();
|
||||
|
||||
while (i != end)
|
||||
{
|
||||
SessionMap::iterator next = i;
|
||||
next++;
|
||||
if (func((*i).second))
|
||||
m_sessionMap.erase(i);
|
||||
i = next;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned
|
||||
SessionManager::CountReadySessions() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user