22 #define BUFFER_SIZE 1024U 28 int main(
int argc,
char* argv[]) {
29 const std::string unicast_address_str =
"127.0.0.1";
30 const short unicast_port = 30001;
35 boost::asio::io_context io_context;
36 boost::asio::steady_timer my_timer(io_context);
43 for (
long int i = 0;; i++) {
47 std::string received_msg(data_buff, data_size);
48 std::cout << received_msg << std::endl;
51 my_timer.expires_after(std::chrono::milliseconds(200));
54 }
catch (std::exception& e) {
55 std::cerr <<
"Exception: " << e.what() <<
"\n";
Receiver data using UDP in unicast mode.
Receiver class using UDP in unicast mode.
size_t receive(char *buffer, const size_t buffer_size)
Receive data using UDP.
void force_specific_source(bool specific_source)
Set wheter to enable any source or source specific. True for specific source, false for any source,...
int main(int argc, char *argv[])