12#include <system_error>
47 const std::vector<uint8_t>&,
96 std::vector<uint8_t>&& data,
Base interface for all network components.
Interface for UDP server components.
virtual auto stop() -> VoidResult=0
Stops the UDP server.
std::function< void( const std::vector< uint8_t > &, const endpoint_info &)> receive_callback_t
Callback type for received data (includes sender endpoint)
virtual auto set_receive_callback(receive_callback_t callback) -> void=0
Sets the callback for received datagrams.
virtual auto start(uint16_t port) -> VoidResult=0
Starts the UDP server on the specified port.
std::function< void(std::error_code, std::size_t)> send_callback_t
Callback type for send completion.
std::function< void(std::error_code)> error_callback_t
Callback type for errors.
virtual auto set_error_callback(error_callback_t callback) -> void=0
Sets the callback for errors.
virtual auto send_to(const endpoint_info &endpoint, std::vector< uint8_t > &&data, send_callback_t handler=nullptr) -> VoidResult=0
Sends a datagram to the specified endpoint.
Base interface for all network components.
Network-specific error and result type definitions.
Endpoint information for UDP datagrams.