tdaq-develop-2025-02-12
TCPDataReceiverProducer.h
1 #ifndef _ots_TCPDataReceiverProducer_h_
2 #define _ots_TCPDataReceiverProducer_h_
3 
4 #include "otsdaq/Configurable/Configurable.h"
5 #include "otsdaq/DataManager/DataProducer.h"
6 #include "otsdaq/NetworkUtilities/TCPSubscribeClient.h" // Make sure this is always first because <sys/types.h> (defined in Socket.h) must be first
7 
8 #include <string>
9 
10 namespace ots
11 {
12 class ConfigurationTree;
13 
15  public Configurable,
16  public TCPSubscribeClient
17 {
18  public:
19  TCPDataReceiverProducer(std::string supervisorApplicationUID,
20  std::string bufferUID,
21  std::string processorUID,
22  const ConfigurationTree& theXDAQContextConfigTree,
23  const std::string& configurationPath);
24  virtual ~TCPDataReceiverProducer(void);
25  virtual void startProcessingData(std::string runNumber) override;
26  virtual void stopProcessingData(void) override;
27 
28  protected:
29  bool workLoopThread(toolbox::task::WorkLoop* workLoop) override;
30  void slowWrite(void);
31  void fastWrite(void);
33  std::string data_;
34  std::map<std::string, std::string> header_;
36  std::string* dataP_;
37  std::map<std::string, std::string>* headerP_;
38 
39  std::string ipAddress_;
40  unsigned short port_;
41  std::string dataType_;
42 
43  // bool getNextFragment(void);
44 };
45 
46 } // namespace ots
47 
48 #endif
std::string data_
For slow write.
bool workLoopThread(toolbox::task::WorkLoop *workLoop) override
bool TCPDataReceiverProducer::getNextFragment(void)
std::string * dataP_
For fast write.