00001 #ifndef MFVIEWER_RECEIVERS_UDP_RECEIVER_HH
00002 #define MFVIEWER_RECEIVERS_UDP_RECEIVER_HH
00003
00004 #include "mfextensions/Receivers/MVReceiver.hh"
00005
00006 #include "messagefacility/MessageLogger/MessageLogger.h"
00007
00008 #include <boost/asio.hpp>
00009 using boost::asio::ip::udp;
00010
00011 namespace mfviewer
00012 {
00016 class UDPReceiver : public MVReceiver
00017 {
00018 Q_OBJECT
00019 public:
00020 explicit UDPReceiver(fhicl::ParameterSet pset);
00021
00022 virtual ~UDPReceiver();
00023
00024
00025 void run() override;
00026
00027
00028 qt_mf_msg read_msg(std::string input);
00029
00030 static bool validate_packet(std::string input);
00031
00032 private:
00033 int port_;
00034 boost::asio::io_service io_service_;
00035 udp::socket socket_;
00036 char buffer_[0x10000];
00037 bool debug_;
00038 };
00039 }
00040
00041 #endif