TraveSim Adapters  0.1
Protobuf adapters for TraveSim project
travesim::udp::UnicastSender Class Reference

Sender class using UDP in unicast mode. More...

#include "unicast_sender.hpp"

Inheritance diagram for travesim::udp::UnicastSender:
Collaboration diagram for travesim::udp::UnicastSender:

Public Member Functions

 UnicastSender (const std::string receiver_address, const short receiver_port)
 Construct a new UnicastSender object. More...
 
- Public Member Functions inherited from travesim::udp::Sender
 Sender (const std::string receiver_address, const short receiver_port)
 Construct a new Sender object. More...
 
virtual ~Sender ()
 Destroy the Sender object. More...
 
size_t send (const char *buffer, const size_t buffer_size)
 Send data using UDP. More...
 
void set_receiver_endpoint (const std::string receiver_address, const short receiver_port)
 Set the receiver endpoint object. More...
 

Additional Inherited Members

- Protected Attributes inherited from travesim::udp::Sender
boost::asio::ip::udp::socket * socket
 
boost::asio::ip::udp::endpoint endpoint
 

Detailed Description

Sender class using UDP in unicast mode.

Definition at line 24 of file unicast_sender.hpp.

Constructor & Destructor Documentation

◆ UnicastSender()

travesim::udp::UnicastSender::UnicastSender ( const std::string  receiver_address,
const short  receiver_port 
)

Construct a new UnicastSender object.

Parameters
receiver_addressAddress where to send data
receiver_portPort where to send data
Note
The unicast addresses must be in the block 127.0.0.0/8, see IANA IPv4 Address Space Registry or the RFC6890 for more informations.

Definition at line 22 of file unicast_sender.cpp.

22  :
23  Sender(receiver_address, receiver_port) {
24  this->socket->set_option(boost::asio::ip::unicast::hops(1));
25 };
Sender(const std::string receiver_address, const short receiver_port)
Construct a new Sender object.
Definition: sender.cpp:33
boost::asio::ip::udp::socket * socket
Definition: sender.hpp:59

References travesim::udp::Sender::socket.


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