TraveSim Adapters
0.1
Protobuf adapters for TraveSim project
|
Sender class using UDP. More...
#include "sender.hpp"
Public Member Functions | |
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... | |
Protected Attributes | |
boost::asio::ip::udp::socket * | socket |
boost::asio::ip::udp::endpoint | endpoint |
Private Attributes | |
boost::asio::io_context | io_context |
Sender class using UDP.
Definition at line 25 of file sender.hpp.
travesim::udp::Sender::Sender | ( | const std::string | receiver_address, |
const short | receiver_port | ||
) |
Construct a new Sender object.
receiver_address | Address where to send data |
receiver_port | Port where to send data |
Definition at line 33 of file sender.cpp.
References endpoint, io_context, set_receiver_endpoint(), and socket.
|
virtual |
size_t travesim::udp::Sender::send | ( | const char * | buffer, |
const size_t | buffer_size | ||
) |
Send data using UDP.
buffer | Buffer to be sent |
buffer_size | Size of the buffer to be sent |
Definition at line 46 of file sender.cpp.
References endpoint, NO_FLAGS, and socket.
void travesim::udp::Sender::set_receiver_endpoint | ( | const std::string | receiver_address, |
const short | receiver_port | ||
) |
Set the receiver endpoint object.
receiver_address | Address where to send data |
receiver_port | Port where to send data |
Definition at line 68 of file sender.cpp.
References endpoint.
|
protected |
Multicast address and port pair
Definition at line 60 of file sender.hpp.
|
private |
boost/asio I/O execution context
Definition at line 63 of file sender.hpp.
|
protected |
Network socket
Definition at line 59 of file sender.hpp.