An asynchronous udp client.
More...
#include <AsyncUDPClient.h>
|
| AsyncUDPClient (const PacketHandler &packet_handler, boost::asio::io_service &io_service, const uint16_t &local_port=0) |
| Constructor of the asynchronous udp client. More...
|
|
| AsyncUDPClient (const PacketHandler &packet_handler, boost::asio::io_service &io_service, const boost::asio::ip::address_v4 host_ip, const boost::asio::ip::address_v4 multi_ip, const uint16_t &local_port=0) |
| Constructor of the asynchronous udp client. More...
|
|
unsigned short | getLocalPort () |
| Returns the actual port assigned to the local machine. More...
|
|
void | runService () |
| Start the listening loop for the udp data packets. More...
|
|
virtual | ~AsyncUDPClient () |
| The destructor of the asynchronous udp client. More...
|
|
An asynchronous udp client.
Definition at line 57 of file AsyncUDPClient.h.
Typedef to a reference to a function. Will be used to process the incoming packets.
Definition at line 63 of file AsyncUDPClient.h.
sick::communication::AsyncUDPClient::AsyncUDPClient |
( |
const PacketHandler & |
packet_handler, |
|
|
boost::asio::io_service & |
io_service, |
|
|
const uint16_t & |
local_port = 0 |
|
) |
| |
Constructor of the asynchronous udp client.
- Parameters
-
packet_handler | Function to handle incoming packets. |
io_service | Instance of the boost io_service. |
local_port | The local port, where the udp packets will arrive. |
Definition at line 40 of file AsyncUDPClient.cpp.
sick::communication::AsyncUDPClient::AsyncUDPClient |
( |
const PacketHandler & |
packet_handler, |
|
|
boost::asio::io_service & |
io_service, |
|
|
const boost::asio::ip::address_v4 |
host_ip, |
|
|
const boost::asio::ip::address_v4 |
multi_ip, |
|
|
const uint16_t & |
local_port = 0 |
|
) |
| |
Constructor of the asynchronous udp client.
- Parameters
-
packet_handler | Function to handle incoming packets. |
io_service | Instance of the boost io_service. |
local_port | The local port, where the udp packets will arrive. |
Definition at line 60 of file AsyncUDPClient.cpp.
sick::communication::AsyncUDPClient::~AsyncUDPClient |
( |
| ) |
|
|
virtual |
sick::communication::AsyncUDPClient::AsyncUDPClient |
( |
AsyncUDPClient & |
| ) |
|
|
private |
unsigned short sick::communication::AsyncUDPClient::getLocalPort |
( |
| ) |
|
Returns the actual port assigned to the local machine.
- Returns
- Local port number
Definition at line 131 of file AsyncUDPClient.cpp.
void sick::communication::AsyncUDPClient::handleReceive |
( |
const boost::system::error_code & |
error, |
|
|
const std::size_t & |
bytes_transferred |
|
) |
| |
|
private |
void sick::communication::AsyncUDPClient::runService |
( |
| ) |
|
void sick::communication::AsyncUDPClient::startReceive |
( |
| ) |
|
|
private |
boost::asio::io_service& sick::communication::AsyncUDPClient::m_io_service |
|
private |
std::shared_ptr<boost::asio::io_service::work> sick::communication::AsyncUDPClient::m_io_work_ptr |
|
private |
PacketHandler sick::communication::AsyncUDPClient::m_packet_handler |
|
private |
boost::asio::ip::udp::endpoint sick::communication::AsyncUDPClient::m_remote_endpoint |
|
private |
std::shared_ptr<boost::asio::ip::udp::socket> sick::communication::AsyncUDPClient::m_socket_ptr |
|
private |
The documentation for this class was generated from the following files: