1 #include "otsdaq/DataProcessorPlugins/UDPDataStreamerConsumer.h"
2 #include "otsdaq/Macros/CoutMacros.h"
3 #include "otsdaq/Macros/ProcessorPluginMacros.h"
4 #include "otsdaq/MessageFacility/MessageFacility.h"
13 UDPDataStreamerConsumer::UDPDataStreamerConsumer(std::string supervisorApplicationUID,
14 std::string bufferUID,
15 std::string processorUID,
17 const std::string& configurationPath)
18 :
Socket(theXDAQContextConfigTree.getNode(configurationPath).getNode(
"HostIPAddress").getValue<std::string>(),
19 theXDAQContextConfigTree.getNode(configurationPath).getNode(
"HostPort").getValue<unsigned int>())
21 ,
UDPDataStreamerBase(theXDAQContextConfigTree.getNode(configurationPath).getNode(
"HostIPAddress").getValue<std::string>(),
22 theXDAQContextConfigTree.getNode(configurationPath).getNode(
"HostPort").getValue<unsigned int>(),
23 theXDAQContextConfigTree.getNode(configurationPath).getNode(
"StreamToIPAddress").getValue<std::string>(),
24 theXDAQContextConfigTree.getNode(configurationPath).getNode(
"StreamToPort").getValue<unsigned int>())
25 ,
DataConsumer(supervisorApplicationUID, bufferUID, processorUID, HighConsumerPriority)
26 ,
Configurable(theXDAQContextConfigTree, configurationPath)
32 __COUT__ <<
"done!" << std::endl;
36 UDPDataStreamerConsumer::~UDPDataStreamerConsumer(
void) {}
39 bool UDPDataStreamerConsumer::workLoopThread(toolbox::task::WorkLoop* )
42 return WorkLoop::continueWorkLoop_;
46 void UDPDataStreamerConsumer::fastRead(
void)
49 if(DataConsumer::read(dataP_, headerP_) < 0)
62 TransmitterSocket::send(streamToSocket_, *dataP_);
63 DataConsumer::setReadSubBuffer<std::string, std::map<std::string, std::string>>();
67 void UDPDataStreamerConsumer::slowRead(
void)
71 if(DataConsumer::read(data_, header_) < 0)
82 TransmitterSocket::send(streamToSocket_, data_);