MIRA
|
This class acts as a sender for multicast messages. More...
#include <communication/MulticastSender.h>
Public Member Functions | |
MulticastSender (const std::string &address, uint16 port) | |
Constructs a multicast sender at the given ip and port and sends the message each interval second. More... | |
MulticastSender (const std::string &address, uint16 port, boost::asio::io_service &service) | |
Constructs a multicast sender at the given ip and port. More... | |
void | start (const Duration &interval, const std::string &message) |
Starts sending a message in the given interval. More... | |
void | send (const std::string &message) |
Sends a single message. More... | |
This class acts as a sender for multicast messages.
It can be bound to a multicast address (224.0.0.0-239.255.255.255) and a port. It will then send a specified message in a defined interval. This class can be used to publish a service in a network or to send cyclic alive messages.
MulticastSender | ( | const std::string & | address, |
uint16 | port | ||
) |
Constructs a multicast sender at the given ip and port and sends the message each interval second.
[in] | address | The multicast address |
[in] | port | The port |
MulticastSender | ( | const std::string & | address, |
uint16 | port, | ||
boost::asio::io_service & | service | ||
) |
Constructs a multicast sender at the given ip and port.
[in] | address | The multicast address |
[in] | port | The port |
service | A service that is shared with other objects |
void start | ( | const Duration & | interval, |
const std::string & | message | ||
) |
Starts sending a message in the given interval.
[in] | interval | Interval to send data |
[in] | message | The message to send |
void send | ( | const std::string & | message | ) |
Sends a single message.