Beispiel #1
0
void SessionManager::addSession(const SessionPtr& session)
{
    if( !session ) return;

    SessionHash* hash = session->getHash();
    assert(hash && sessions.Find(*hash) == sessions.End());

    sessions[*hash] = session;

    onSessionAdded(session);
}
Beispiel #2
0
void SessionManager::removeSession(const SessionPtr& session)
{
    if( !session ) return;

    SessionHash* hash = session->getHash();
    assert(hash);

    auto it = sessions.Find(*hash);
    
    if (it == sessions.End())
        return;

    sessions.Erase(it);

    onSessionRemoved(session);
}