47 #ifndef _MIRA_MULTICASTSENDER_H_ 48 #define _MIRA_MULTICASTSENDER_H_ 51 #include <boost/thread.hpp> 52 #include <boost/utility.hpp> 96 void start(
const Duration& interval,
const std::string& message);
101 void send(
const std::string& message);
104 void handleTimeout(
const boost::system::error_code& error);
108 boost::asio::ip::udp::endpoint mEndpoint;
109 boost::asio::ip::udp::socket mSocket;
110 #if BOOST_VERSION < 106600 111 boost::asio::deadline_timer mTimer;
113 boost::asio::system_timer mTimer;
116 std::string mMessage;
void start(const Duration &interval, const std::string &message)
Starts sending a message in the given interval.
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
Time and Duration wrapper class.
Core class of the logging library.
Use this class to represent time durations.
Definition: Time.h:106
boost::asio::io_service BoostAsioIOObjectType
Our own typedef for boost::asio::io_service to avoid having too many ifdef's.
Definition: IOService.h:73
MulticastSender(const std::string &address, uint16 port)
Constructs a multicast sender at the given ip and port and sends the message each interval second...
void send(const std::string &message)
Sends a single message.
Wrapper class for boost::asio::io_service.
Definition: IOService.h:85
boost::shared_ptr< MulticastSender > MulticastSenderPtr
A shared pointer wrapper for class MulticastSender.
Definition: MulticastSender.h:120
This class acts as a sender for multicast messages.
Definition: MulticastSender.h:71
Wrapper for boost::asio::io_service / boost::asio::io_context.