1 #include "otsdaq-core/DataProcessorPlugins/UDPDataStreamerConsumer.h"
2 #include "otsdaq-core/Macros/CoutMacros.h"
3 #include "otsdaq-core/Macros/ProcessorPluginMacros.h"
4 #include "otsdaq-core/MessageFacility/MessageFacility.h"
13 UDPDataStreamerConsumer::UDPDataStreamerConsumer(
14 std::string supervisorApplicationUID,
15 std::string bufferUID,
16 std::string processorUID,
18 const std::string& configurationPath)
19 :
Socket(theXDAQContextConfigTree.getNode(configurationPath)
20 .getNode(
"HostIPAddress")
21 .getValue<std::string>(),
22 theXDAQContextConfigTree.getNode(configurationPath)
24 .getValue<unsigned int>())
27 .getNode(
"HostIPAddress")
28 .getValue<std::string>(),
29 theXDAQContextConfigTree.getNode(configurationPath)
31 .getValue<unsigned int>(),
32 theXDAQContextConfigTree.getNode(configurationPath)
33 .getNode(
"StreamToIPAddress")
34 .getValue<std::string>(),
35 theXDAQContextConfigTree.getNode(configurationPath)
36 .getNode(
"StreamToPort")
37 .getValue<unsigned int>())
39 supervisorApplicationUID, bufferUID, processorUID, HighConsumerPriority)
40 ,
Configurable(theXDAQContextConfigTree, configurationPath)
46 __COUT__ <<
"done!" << std::endl;
50 UDPDataStreamerConsumer::~UDPDataStreamerConsumer(
void) {}
53 bool UDPDataStreamerConsumer::workLoopThread(toolbox::task::WorkLoop* workLoop)
56 return WorkLoop::continueWorkLoop_;
60 void UDPDataStreamerConsumer::fastRead(
void)
63 if(DataConsumer::read(dataP_, headerP_) < 0)
76 TransmitterSocket::send(streamToSocket_, *dataP_);
77 DataConsumer::setReadSubBuffer<std::string, std::map<std::string, std::string>>();
81 void UDPDataStreamerConsumer::slowRead(
void)
85 if(DataConsumer::read(data_, header_) < 0)
96 TransmitterSocket::send(streamToSocket_, data_);