コード例 #1
0
ファイル: AddressBook.cpp プロジェクト: 01BTC10/i2pd
 void AddressBook::Start (ClientDestination* local_destination)
 {
     m_SharedLocalDestination = local_destination;
     StartSubscriptions ();
 }
コード例 #2
0
//-------------------------------------------------------
void PersistenceHandler::Start(bool restore)
{
    if (m_started)
    {
        m_debug << "Persistence handling already started."<< std::endl;
        return;
    }

    m_debug << "Starting Persistence handling"<< std::endl;

    try
    {
        m_dobConnection.Open(L"DOPE_SUBSCRIBE", L"0", PERSISTENCE_CONTEXT, nullptr, &m_dispatcher);
        m_debug << "Opened DOB connection DOPE_SUBSCRIBE"<<std::endl;
    }
    catch (Safir::Dob::NotOpenException e)
    {
        Safir::Logging::SendSystemLog(Safir::Logging::Critical,
                                      L"PersistenceHandler failed to connect to Dob, Maybe Dope is already running?");
        throw StartupError();
    }

    PerformStartupChecks();

    if (restore)
    {
        // Normal startup
        try
        {
            m_debug << "Restoring all stored entities"<< std::endl;
            RestoreAll();
        }
        catch (const Safir::Dob::AccessDeniedException & e)
        {
            throw Safir::Dob::Typesystem::SoftwareViolationException
                (std::wstring(L"DOSE gave me AccessDeniedException when I was trying to Set persisted data! AccessDeniedException info: ") +
                e.GetExceptionInfo(),__WFILE__,__LINE__);
        }

        StartSubscriptions();
        ReportPersistentDataReady();
    }
    else
    {
        // Failover startup, don't restore anything.

        if (Safir::Dob::PersistenceParameters::StandaloneMode())
        {
            // If standalone mode then clear all before starting subscriptions
            RemoveAll();
        }

        StartSubscriptions();
    }

    // Start timer
    HandleTimeout();

    m_started = true;
    m_debug << "Persistence handling successfully started"<<std::endl;
}
コード例 #3
0
ファイル: AddressBook.cpp プロジェクト: evmarkov/i2pd
	void AddressBook::Start ()
	{
		StartSubscriptions ();
	}