예제 #1
0
//--------------------------------------------------------------------------------------------
TSession* TManagerSession::NewSession(TIP_Port& ip_port, INetTransport* pTransport)
{
    mLastID_Session++;// нет проверки на совпадение, unsigned int 4 млрд - слишком много
    TSession* pSession = new TSession(mTimeLiveSession);
    pSession->SetTransport(pTransport);
    pSession->SetInfo(ip_port);
    pSession->SetID(mLastID_Session);

    mNavigateSession->Add(pSession);
    return pSession;
}
예제 #2
0
//--------------------------------------------------------------------------------------------
TSession* TSessionManager::NewSession( TIP_Port& ip_port, INetTransport* pTransport, bool connectTo_elseFrom )
{
  auto state = connectTo_elseFrom ? TSession::StateWaitConnectTo : TSession::StateWaitLogin;

  mLastID_Session++;// нет проверки на совпадение, unsigned int 4 млрд - слишком много
  TSession* pSession = new TSession( state, mTimeLiveSession );
  pSession->SetTransport( pTransport );
  pSession->SetInfo( ip_port );
  pSession->SetID( mLastID_Session );

  mNavigateSession->Add( pSession );
  return pSession;
}