mirror of
https://github.com/LX3JL/xlxd.git
synced 2026-04-05 22:45:24 +00:00
xlxd 1.2.4 / db 2.1.0
implement XLX interlink feature
This commit is contained in:
parent
4831ba8829
commit
2f9e8a8781
259 changed files with 2603 additions and 647 deletions
|
|
@ -96,18 +96,26 @@ bool CReflector::Start(void)
|
|||
|
||||
// create protocols
|
||||
ok &= m_Protocols.Init();
|
||||
|
||||
// start one thread per reflector module
|
||||
for ( int i = 0; i < NB_OF_MODULES; i++ )
|
||||
|
||||
// if ok, start threads
|
||||
if ( ok )
|
||||
{
|
||||
m_RouterThreads[i] = new std::thread(CReflector::RouterThread, this, &(m_Streams[i]));
|
||||
}
|
||||
// start one thread per reflector module
|
||||
for ( int i = 0; i < NB_OF_MODULES; i++ )
|
||||
{
|
||||
m_RouterThreads[i] = new std::thread(CReflector::RouterThread, this, &(m_Streams[i]));
|
||||
}
|
||||
|
||||
// start the reporting threads
|
||||
m_XmlReportThread = new std::thread(CReflector::XmlReportThread, this);
|
||||
// start the reporting threads
|
||||
m_XmlReportThread = new std::thread(CReflector::XmlReportThread, this);
|
||||
#ifdef JSON_MONITOR
|
||||
m_JsonReportThread = new std::thread(CReflector::JsonReportThread, this);
|
||||
m_JsonReportThread = new std::thread(CReflector::JsonReportThread, this);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Protocols.Close();
|
||||
}
|
||||
|
||||
// done
|
||||
return ok;
|
||||
|
|
@ -531,14 +539,33 @@ void CReflector::WriteXmlFile(std::ofstream &xmlFile)
|
|||
::sprintf(sz, "%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION);
|
||||
xmlFile << "<Version>" << sz << "</Version>" << std::endl;
|
||||
|
||||
// linked nodes
|
||||
xmlFile << "<" << m_Callsign << "linked nodes>" << std::endl;
|
||||
// linked peers
|
||||
xmlFile << "<" << m_Callsign << "linked peers>" << std::endl;
|
||||
// lock
|
||||
CClients *clients = GetClients();
|
||||
// iterate on clients
|
||||
for ( int i = 0; i < clients->GetSize(); i++ )
|
||||
{
|
||||
clients->GetClient(i)->WriteXml(xmlFile);
|
||||
if ( clients->GetClient(i)->IsPeer() )
|
||||
{
|
||||
clients->GetClient(i)->WriteXml(xmlFile);
|
||||
}
|
||||
}
|
||||
// unlock
|
||||
ReleaseClients();
|
||||
xmlFile << "</" << m_Callsign << "linked peers>" << std::endl;
|
||||
|
||||
// linked nodes
|
||||
xmlFile << "<" << m_Callsign << "linked nodes>" << std::endl;
|
||||
// lock
|
||||
clients = GetClients();
|
||||
// iterate on clients
|
||||
for ( int i = 0; i < clients->GetSize(); i++ )
|
||||
{
|
||||
if ( clients->GetClient(i)->IsNode() )
|
||||
{
|
||||
clients->GetClient(i)->WriteXml(xmlFile);
|
||||
}
|
||||
}
|
||||
// unlock
|
||||
ReleaseClients();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue