Go to the documentation of this file.
35 #ifndef SICK_SAFETYSCANNERS_COMMUNICATION_ASYNCUDPCLIENT_H
36 #define SICK_SAFETYSCANNERS_COMMUNICATION_ASYNCUDPCLIENT_H
43 #include <boost/array.hpp>
44 #include <boost/asio.hpp>
45 #include <boost/cstdint.hpp>
46 #include <boost/function.hpp>
52 namespace communication {
73 boost::asio::io_service& io_service,
74 const uint16_t& local_port = 0);
84 boost::asio::io_service& io_service,
85 const boost::asio::ip::address_v4 host_ip,
86 const boost::asio::ip::address_v4 interface_ip,
87 const uint16_t& local_port = 0);
116 void handleReceive(
const boost::system::error_code& error,
const std::size_t& bytes_transferred);
124 #endif // SICK_SAFETYSCANNERS_COMMUNICATION_ASYNCUDPCLIENT_H
std::shared_ptr< boost::asio::io_service::work > m_io_work_ptr
std::shared_ptr< boost::asio::ip::udp::socket > m_socket_ptr
AsyncUDPClient(const PacketHandler &packet_handler, boost::asio::io_service &io_service, const uint16_t &local_port=0)
Constructor of the asynchronous udp client.
boost::asio::io_service & m_io_service
virtual ~AsyncUDPClient()
The destructor of the asynchronous udp client.
An asynchronous udp client.
boost::array< uint8_t, MAXSIZE > ArrayBuffer
Typedef for an arraybuffer which can be read from the sensor.
datastructure::PacketBuffer::ArrayBuffer m_recv_buffer
boost::function< void(const sick::datastructure::PacketBuffer &)> PacketHandler
Typedef to a reference to a function. Will be used to process the incoming packets.
A packetbuffer for the raw data from the sensor.
void handleReceive(const boost::system::error_code &error, const std::size_t &bytes_transferred)
boost::asio::ip::udp::endpoint m_remote_endpoint
unsigned short getLocalPort()
Returns the actual port assigned to the local machine.
void runService()
Start the listening loop for the udp data packets.
PacketHandler m_packet_handler