This seems to be a problem that many people experience, but all the answers that I have found so far have not helped.
Problem: I am trying to listen to Velodyne HDL32, which sends its packets via UDP to my computer. The OS is a 32-bit Ubuntu library and Boost v1.46.
The data that I get through Wireshark is as follows:
Time | Source | Destination | Protocol | Length | Source Port | Destination Port 0.000000 | 192.168.17.212 | 192.168.3.255 | UDP | 1248 | https | opentable
But with this code no data is shown to me (Port is correct):
receiver(boost::asio::io_service& io_service, const boost::asio::ip::address& listen_address) : m_socket(io_service) { boost::asio::ip::address ipAddr = boost::asio::ip::address_v4::any(); boost::asio::ip::udp::endpoint listen_endpoint( ipAddr, 2368); m_socket.open(listen_endpoint.protocol()); m_socket.bind(listen_endpoint); m_socket.async_receive_from( boost::asio::buffer(m_data, max_length), m_sender_endpoint, boost::bind(&receiver::handle_receive_from, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } void handle_receive_from(const boost::system::error_code& error, size_t bytes_recvd) { std::cout << "receive" << bytes_recvd << std::endl; m_socket.async_receive_from( boost::asio::buffer(m_data, max_length), m_sender_endpoint, boost::bind(&receiver::handle_receive_from, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); }
Can someone identify the problem so far or do you need more information? I appreciate any help I can get.
Note: I DO NOT run a program with root privileges!
Some thoughts: Is it possible that boost :: asio :: ip :: address_v4 :: any () will not listen on IP .. *. 255 if there is a subnet of 255.255.255.0?
When using netcat, data is not displayed. When I use Windows netcat, it works fine. Same thing with Wireshark on Linux and Windows - works great. I tried with this, but with the same effect - no data.