Go to the documentation of this file.
75 std::function<
void(
const std::vector<uint8_t>&)> receive_callback);
std::unique_ptr< sockaddr_in > sensor_address
std::atomic_bool m_stop
Atomic flag to stop the rx_thread on destruction.
std::thread m_rx_thread
The rx_thread object which is spawned on construction.
void rx_thread()
The rx thread function which is receives UDP data.
size_t m_max_mtu
The amount of data to read off the socket during each read operation.
int64_t publish_data(const NetworkSocket &socket, const std::vector< uint8_t > &data)
Convenience function used to user specified data out on the host's UDP socket.
Convenience network socket object which contains the data corresponding to our connection.
std::function< void(const std::vector< uint8_t > &)> m_receive_callback
User specified callback which is called once UDP data is received.
Convenience object which receives data from a UDP socket and dispatches to a user defined callback....
std::vector< uint8_t > m_incoming_buffer
Internal buffer used to write incoming UDP data into.
uint16_t server_socket_port
UdpReceiver(const NetworkSocket &socket, size_t max_mtu, std::function< void(const std::vector< uint8_t > &)> receive_callback)
Construct a UDP receiver for a given socket, and call a user callback whenever there is data availabl...
socket_t m_socket
The internal socket which UDP data is receive on.