minor cleanup

unstable
Tom Early 4 years ago
parent 55deafb30c
commit d013a3d532

@ -22,11 +22,6 @@
#include "DVFramePacket.h"
#include "Reflector.h"
////////////////////////////////////////////////////////////////////////////////////////
// define
////////////////////////////////////////////////////////////////////////////////////////
// constructor
@ -198,7 +193,7 @@ void CCodecStream::Task(void)
}
else
{
std::cout << "Unexpected transcoded packet received from ambed" << std::endl;
std::cout << "Unexpected transcoded packet received from transcoder" << std::endl;
}
}
}

@ -18,7 +18,6 @@
#pragma once
#include "Semaphore.h"
#include "UDPSocket.h"
#include "PacketQueue.h"

@ -69,7 +69,7 @@ $(EXE) : $(OBJS)
g++ $(CFLAGS) $< -o $@
clean :
$(RM) *.o *.d ulxd xrfd
$(RM) *.o *.d urfd
-include $(DEPS)

@ -94,7 +94,7 @@ bool CReflector::Start(void)
for (auto it=m_Modules.cbegin(); it!=m_Modules.cend(); it++)
{
m_Stream[*it] = std::make_shared<CPacketStream>();
m_RouterFuture[*it] = std::async(std::launch::async, &CReflector::RouterThread, this, m_Stream[*it]);
m_RouterFuture[*it] = std::async(std::launch::async, &CReflector::RouterThread, this, *it);
}
// start the reporting threads
@ -255,16 +255,12 @@ void CReflector::CloseStream(std::shared_ptr<CPacketStream> stream)
////////////////////////////////////////////////////////////////////////////////////////
// router threads
void CReflector::RouterThread(std::shared_ptr<CPacketStream> streamIn)
void CReflector::RouterThread(const char ThisModule)
{
// get our module
const auto module = GetStreamModule(streamIn);
// get on input queue
std::unique_ptr<CPacket> packet;
while (keep_running)
{
std::unique_ptr<CPacket> packet;
auto streamIn = m_Stream[ThisModule];
// any packet in our input queue ?
streamIn->Lock();
if ( !streamIn->empty() )
@ -282,7 +278,7 @@ void CReflector::RouterThread(std::shared_ptr<CPacketStream> streamIn)
if ( packet != nullptr )
{
// set origin
packet->SetModule(module);
packet->SetModule(ThisModule);
// iterate on all protocols
m_Protocols.Lock();
@ -296,7 +292,7 @@ void CReflector::RouterThread(std::shared_ptr<CPacketStream> streamIn)
{
// get our callsign
CCallsign csRPT = (*it)->GetReflectorCallsign();
csRPT.SetModule(GetStreamModule(streamIn));
csRPT.SetModule(ThisModule);
(dynamic_cast<CDvHeaderPacket *>(packetClone.get()))->SetRpt2Callsign(csRPT);
}

@ -87,7 +87,7 @@ public:
protected:
// threads
void RouterThread(std::shared_ptr<CPacketStream>);
void RouterThread(const char);
void XmlReportThread(void);
#ifdef JSON_MONITOR
void JsonReportThread(void);
@ -130,7 +130,10 @@ protected:
// threads
std::atomic<bool> keep_running;
std::unordered_map<char, std::future<void>> m_RouterFuture;
std::future<void> m_XmlReportFuture /*, m_JsonReportFuture*/;
std::future<void> m_XmlReportFuture;
#ifdef JSON_MONITOR
std::future<void> m_JsonReportFuture;
#endif
// notifications
CNotificationQueue m_Notifications;

Loading…
Cancel
Save

Powered by TurnKey Linux.