artdaq_mfextensions  v1_04_00
UDP_receiver.hh
1 #ifndef MFVIEWER_RECEIVERS_UDP_RECEIVER_HH
2 #define MFVIEWER_RECEIVERS_UDP_RECEIVER_HH
3 
4 #include "mfextensions/Receivers/MVReceiver.hh"
5 
6 #include "messagefacility/MessageLogger/MessageLogger.h"
7 
8 namespace mfviewer {
12 class UDPReceiver : public MVReceiver
13 {
14  Q_OBJECT
15 public:
20  explicit UDPReceiver(fhicl::ParameterSet pset);
21 
25  virtual ~UDPReceiver();
26 
30  void run() override;
31 
37  qt_mf_msg read_msg(std::string input);
38 
44  static bool validate_packet(std::string input);
45 
46 private:
47  void setupMessageListener_();
48 
49  int message_port_;
50  std::string message_addr_;
51  bool multicast_enable_;
52  std::string multicast_out_addr_;
53  int message_socket_;
54 
55  std::list<std::string> tokenize_(std::string const& input);
56 };
57 } // namespace mfviewer
58 
59 #endif
void run() override
Receiver method. Receive messages and emit NewMessage signal
Definition: UDP_receiver.cc:75
static bool validate_packet(std::string input)
Run simple validation tests on message
Receive messages through a UDP socket. Expects the syslog format provided by UDP_mfPlugin (ELUDP) ...
Definition: UDP_receiver.hh:12
UDPReceiver(fhicl::ParameterSet pset)
UDPReceiver Constructor
Definition: UDP_receiver.cc:10
Qt wrapper around MessageFacility message
Definition: qt_mf_msg.hh:36
virtual ~UDPReceiver()
Destructor – Close socket
Definition: UDP_receiver.cc:68
A MVReceiver class listens for messages and raises a signal when one arrives
Definition: MVReceiver.hh:17
qt_mf_msg read_msg(std::string input)
Parse incoming message