Commit a1fb492b authored by Marco De Marco's avatar Marco De Marco
Browse files

Modified list update loop and minor fix

parent 2b323ce6
Loading
Loading
Loading
Loading
+22 −11
Original line number Original line Diff line number Diff line
@@ -208,26 +208,41 @@ void Client::startUpdateLists()
        writeStatus("Unknown error");
        writeStatus("Unknown error");
    }
    }


    handleUpdateLists();
    if(readState() != Tango::ALARM && m_protocolManager_sp->hasNextFile())
    {
        startResolve();
    }
    else
    {
        m_listsUpdateTimer.expires_from_now(
            boost::posix_time::seconds(m_configuration_sp->getRefreshTime()));

        m_listsUpdateTimer.async_wait(boost::bind(&Client::handleUpdateLists,
            this, boost::asio::placeholders::error));
    }
}
}


//==============================================================================
//==============================================================================
//      Client::handleUpdateLists()
//      Client::handleUpdateLists()
//==============================================================================
//==============================================================================
void Client::handleUpdateLists()
void Client::handleUpdateLists(const boost::system::error_code& errorCode)
{
{
    DEBUG_STREAM << "Client::handleUpdateLists()" << endl;
    DEBUG_STREAM << "Client::handleUpdateLists()" << endl;


    if(readState() != Tango::ALARM && m_protocolManager_sp->hasNextFile())
    if(!errorCode)
    {
    {
        startResolve();
        startUpdateLists();
    }
    else if(errorCode == boost::asio::error::operation_aborted)
    {
        DEBUG_STREAM << "Client::handleUpdateLists() STOP" << endl;
    }
    }
    else
    else
    {
    {
        m_listsUpdateTimer.expires_from_now(
        ERROR_STREAM << "Client::handleResolve() " << errorCode.message() << endl;
            boost::posix_time::seconds(m_configuration_sp->getRefreshTime()));


        m_listsUpdateTimer.async_wait(boost::bind(&Client::handleUpdateLists, this));
        writeState(Tango::ALARM);
        writeStatus(errorCode.message());
    }
    }
}
}


@@ -420,8 +435,6 @@ void Client::onTransferCompleted(FileWrapper::SP fileWrapper_sp)
    {
    {
        m_protocolManager_sp->setFileTransfered(fileWrapper_sp);
        m_protocolManager_sp->setFileTransfered(fileWrapper_sp);


        m_protocolManager_sp->nextFile();

        if(m_protocolManager_sp->hasNextFile())
        if(m_protocolManager_sp->hasNextFile())
        {
        {
            startWriteRequest();
            startWriteRequest();
@@ -460,8 +473,6 @@ void Client::onTransferFailed()
    {
    {
        m_protocolManager_sp->setFileFailed();
        m_protocolManager_sp->setFileFailed();


        m_protocolManager_sp->nextFile();

        if(m_protocolManager_sp->hasNextFile())
        if(m_protocolManager_sp->hasNextFile())
        {
        {
            startWriteRequest();
            startWriteRequest();
+1 −1
Original line number Original line Diff line number Diff line
@@ -69,7 +69,7 @@ protected:
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
    virtual void startUpdateLists();
    virtual void startUpdateLists();


    virtual void handleUpdateLists();
    virtual void handleUpdateLists(const boost::system::error_code&);


//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//  [Protected] Endpoint resolution methods
//  [Protected] Endpoint resolution methods
+4 −4
Original line number Original line Diff line number Diff line
@@ -26,7 +26,7 @@ DBManager::DBManager(Tango::DeviceImpl* deviceImpl_p,
}
}


//==============================================================================
//==============================================================================
//      DBManager::DBManager()
//      DBManager::~DBManager()
//==============================================================================
//==============================================================================
DBManager::~DBManager()
DBManager::~DBManager()
{
{
@@ -38,7 +38,7 @@ DBManager::~DBManager()
}
}


//==============================================================================
//==============================================================================
//      DBManager::DBManager()
//      DBManager::create()
//==============================================================================
//==============================================================================
DBManager::SP DBManager::create(Tango::DeviceImpl* deviceImpl_p,
DBManager::SP DBManager::create(Tango::DeviceImpl* deviceImpl_p,
    Configuration::SP configuration_sp)
    Configuration::SP configuration_sp)
+1 −1
Original line number Original line Diff line number Diff line
@@ -610,7 +610,7 @@ void DataImporter::get_device_property()
//--------------------------------------------------------
//--------------------------------------------------------
void DataImporter::always_executed_hook()
void DataImporter::always_executed_hook()
{
{
	INFO_STREAM << "DataImporter::always_executed_hook()  " << device_name << endl;
	DEBUG_STREAM << "DataImporter::always_executed_hook()  " << device_name << endl;
	/*----- PROTECTED REGION ID(DataImporter::always_executed_hook) ENABLED START -----*/
	/*----- PROTECTED REGION ID(DataImporter::always_executed_hook) ENABLED START -----*/


    if(get_state() != Tango::FAULT)
    if(get_state() != Tango::FAULT)
+1 −0
Original line number Original line Diff line number Diff line
@@ -242,6 +242,7 @@ void PlainClient::closeConnection()


    INFO_STREAM << "PlainClient::closeConnection() " << infoStream.str() << endl;
    INFO_STREAM << "PlainClient::closeConnection() " << infoStream.str() << endl;


    m_listsUpdateTimer.expires_at(boost::posix_time::pos_infin);
    m_resetConnectionTimer.expires_at(boost::posix_time::pos_infin);
    m_resetConnectionTimer.expires_at(boost::posix_time::pos_infin);


    boost::system::error_code errorCode;
    boost::system::error_code errorCode;
Loading