diff --git a/ZoomPipeline_FuncSvr/zpmainframe.cpp b/ZoomPipeline_FuncSvr/zpmainframe.cpp index 9c53f4081c096f2d6c09d6f74e5155f0c3fffe4a..7714c486afe741ecb2fb6fe1e59bbc0ced3ea592 100644 --- a/ZoomPipeline_FuncSvr/zpmainframe.cpp +++ b/ZoomPipeline_FuncSvr/zpmainframe.cpp @@ -365,6 +365,19 @@ void ZPMainFrame::timerEvent(QTimerEvent * e) m_clientTable->KickDeadClients(); m_pClusterTerm->SendHeartBeatings(); m_pClusterTerm->KickDeadClients(); + if (ui->action_Start_Stop->isChecked()==true) + { + //Cluster re-connection Test + QStringList lstCluster = m_pClusterTerm->SvrNames(); + if (lstCluster.size()==0 && m_dtmLastClusterJoin.secsTo(QDateTime::currentDateTime())>=120) + { + QSettings settings(this->m_currentConfigFile,QSettings::IniFormat); + QString strAddr = settings.value("history/clusterAddr","192.168.1.118").toString(); + QString strPort = settings.value("history/clusterPort","25600").toString(); + m_pClusterTerm->JoinCluster(QHostAddress(strAddr),strPort.toInt()); + m_dtmLastClusterJoin = QDateTime::currentDateTime(); + } + } m_nTimerCheck = startTimer(5000); } } @@ -373,6 +386,8 @@ void ZPMainFrame::on_action_Start_Stop_triggered(bool setordel) if (setordel==true) { forkServer(m_currentConfigFile); + //Cluster Reconnection Dtm Protect + m_dtmLastClusterJoin = QDateTime::currentDateTime(); } else { @@ -815,6 +830,8 @@ void ZPMainFrame::on_actionReload_config_file_triggered() m_currentConfigFile = filename; LoadSettings(m_currentConfigFile); forkServer(m_currentConfigFile); + //Cluster Reconnection Dtm Protect + m_dtmLastClusterJoin = QDateTime::currentDateTime(); } } void ZPMainFrame::on_pushButton_db_add_clicked() diff --git a/ZoomPipeline_FuncSvr/zpmainframe.h b/ZoomPipeline_FuncSvr/zpmainframe.h index 5aa81824ebccb8665604091bd1909a43cf85c149..579be10fb609c9365fd742d245504eadfe88d918 100644 --- a/ZoomPipeline_FuncSvr/zpmainframe.h +++ b/ZoomPipeline_FuncSvr/zpmainframe.h @@ -59,6 +59,8 @@ private: ExampleServer::st_client_table * m_clientTable; ZPDatabase::DatabaseResource * m_pDatabases; ZP_Cluster::zp_ClusterTerm * m_pClusterTerm; + //Cluster Reconnection + QDateTime m_dtmLastClusterJoin; int m_nTimerId; void initUI(); void LoadSettings(QString config_file);