MIRA
Public Member Functions | List of all members
MulticastSender Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MulticastSender() [1/2]

MulticastSender ( const std::string &  address,
uint16  port 
)

Constructs a multicast sender at the given ip and port and sends the message each interval second.

Parameters
[in]addressThe multicast address
[in]portThe port

◆ MulticastSender() [2/2]

MulticastSender ( const std::string &  address,
uint16  port,
boost::asio::io_service &  service 
)

Constructs a multicast sender at the given ip and port.

Parameters
[in]addressThe multicast address
[in]portThe port
serviceA service that is shared with other objects

Member Function Documentation

◆ start()

void start ( const Duration interval,
const std::string &  message 
)

Starts sending a message in the given interval.

Parameters
[in]intervalInterval to send data
[in]messageThe message to send

◆ send()

void send ( const std::string &  message)

Sends a single message.


The documentation for this class was generated from the following file: