//-------------------------------------------------------------------------
bool TSessionManager::GetInfo( unsigned int ID_Session, TIP_Port& ip_port_out )
{
  bool res = false;
  if( mNavigateSession == nullptr )
    return false;
  //===================================================================
  TSession* pSession = mNavigateSession->FindSessionByID( ID_Session );
  if( pSession )
  {
    res = true;
    pSession->GetInfo( ip_port_out );
  }
  return res;
}
Beispiel #2
0
//-------------------------------------------------------------------------
bool TManagerSession::GetInfo(unsigned int ID_Session, TIP_Port& ip_port_out)
{
    bool res = false;
    lockAccessSession();
    if(mNavigateSession==NULL)
    {
        unlockAccessSession();
        return false;
    }
    //===================================================================
    TSession* pSession = mNavigateSession->FindSessionByID(ID_Session);
    if(pSession)
    {
        res = true;
        pSession->GetInfo(ip_port_out);
    }
    unlockAccessSession();
    return res;
}
Beispiel #3
0
//-------------------------------------------------------------------------
bool TManagerSession::GetRSAPublicKey(unsigned int id_session, TContainer& cRSA)
{
    bool res = false;
    TIP_Port ip_port;
    lockAccessSession();
    if(mNavigateSession==NULL)
    {
        unlockAccessSession();
        return res;
    }
    //===================================================================
    TSession* pSession = mNavigateSession->FindSessionByID(id_session);
    if(pSession)
    {
        pSession->GetInfo(ip_port);
        res = mMngCtxCrypto.GetRSAkeyByIP(ip_port, cRSA);
    }

    unlockAccessSession();
    return res;
}
Beispiel #4
0
//--------------------------------------------------------------------------------------------
void TManagerSession::CloseSession(unsigned int ID_Session)
{
    if(ID_Session==INVALID_HANDLE_SESSION)
        return;

    lockAccessSession();
    if(mNavigateSession==NULL)
    {
        unlockAccessSession();
        return;
    }
    //===================================================================
    TSession* pSession = mNavigateSession->FindSessionByID(ID_Session);
    if(pSession)
    {
        TIP_Port ip_port;
        pSession->GetInfo(ip_port);
        mMngCtxCrypto.Close(ip_port);

        mNavigateSession->Delete(pSession);
    }
    unlockAccessSession();
}