TraveSim Adapters
0.1
Protobuf adapters for TraveSim project
|
Receiver class using UDP in multicast mode. More...
#include "multicast_receiver.hpp"
Public Member Functions | |
MulticastReceiver (const std::string multicast_address, const short multicast_port, const std::string receiver_address) | |
Construct a new Multicast Receiver object. More... | |
MulticastReceiver (const std::string multicast_address, const short multicast_port) | |
Construct a new Multicast Receiver object. More... | |
~MulticastReceiver () | |
Destroy the Multicast Receiver object. More... | |
void | set_multicast_address (const std::string multicast_address) |
Set the multicast address. More... | |
![]() | |
Receiver (const std::string receiver_address, const short receiver_port) | |
Construct a new Receiver object. More... | |
virtual | ~Receiver () |
Destroy the Receiver object. More... | |
size_t | receive (char *buffer, const size_t buffer_size) |
Receive data using UDP. More... | |
size_t | receive_latest (char *buffer, const size_t buffer_size) |
Receive the latest data using UDP. More... | |
void | force_specific_source (bool specific_source) |
Set wheter to enable any source or source specific. True for specific source, false for any source, default is false. More... | |
void | set_receiver_endpoint (const std::string receiver_address, const short receiver_port) |
Set the receiver endpoint. More... | |
void | reset (void) |
Reset the receiver. More... | |
Private Member Functions | |
void | open_socket () |
Open the socket with the desired options. More... | |
void | close_socket () |
Close the socket. More... | |
Private Attributes | |
boost::asio::ip::address | multicast_address |
Additional Inherited Members | |
![]() | |
boost::asio::ip::udp::socket * | socket |
boost::asio::ip::udp::endpoint | receiver_endpoint |
Receiver class using UDP in multicast mode.
Definition at line 24 of file multicast_receiver.hpp.
travesim::udp::MulticastReceiver::MulticastReceiver | ( | const std::string | multicast_address, |
const short | multicast_port, | ||
const std::string | receiver_address | ||
) |
Construct a new Multicast Receiver object.
multicast_address | Multicas group address |
multicast_port | Multicast group port |
receiver_address | Receiver address, has a filtering role, setting where the data may be received |
Definition at line 22 of file multicast_receiver.cpp.
References open_socket(), and set_multicast_address().
travesim::udp::MulticastReceiver::MulticastReceiver | ( | const std::string | multicast_address, |
const short | multicast_port | ||
) |
Construct a new Multicast Receiver object.
multicast_address | Multicas group address |
multicast_port | Multicast group port |
Definition at line 29 of file multicast_receiver.cpp.
travesim::udp::MulticastReceiver::~MulticastReceiver | ( | ) |
Destroy the Multicast Receiver object.
Definition at line 33 of file multicast_receiver.cpp.
References close_socket().
|
privatevirtual |
Close the socket.
Reimplemented from travesim::udp::Receiver.
Definition at line 62 of file multicast_receiver.cpp.
References multicast_address, and travesim::udp::Receiver::socket.
|
privatevirtual |
Open the socket with the desired options.
Implements travesim::udp::Receiver.
Definition at line 46 of file multicast_receiver.cpp.
References multicast_address, travesim::udp::Receiver::receiver_endpoint, and travesim::udp::Receiver::socket.
void travesim::udp::MulticastReceiver::set_multicast_address | ( | const std::string | multicast_address | ) |
Set the multicast address.
multicast_address | Multicast group address in a string |
Definition at line 37 of file multicast_receiver.cpp.
References multicast_address.
|
private |
Definition at line 78 of file multicast_receiver.hpp.