Can anyone discern what I’m doing wrong here? According to the documentation in 1.47 basic_datagram_socket inherits from basic_socket so the non_blocking() or non_blocking(bool) should be inherited.
Thanks
Error 1 error C2039: ‘non_blocking’ : is not a member of ‘boost::asio::basic_datagram_socket’ c:\DEV\projects\topoTest\topoTest\multiReceiver.cpp 129
This is the call.
socket_.non_blocking(true);
and the socket is defined as follows within a class:
boost::asio::ip::udp::socket socket_;
The member function
boost::asio::ip::udp::socket::non_blocking()appears to be new in 1.47. Either it doesn’t actually exist in 1.47 or you’re actually using an older header. I’d suggest finding the<boost/asio/basic_datagram_socket.hpp>header that’s being included to see if it actually has that member function as part of thebasic_datagram_socketclass. If not, you can always do it the old way like Steve Townsend said in his answer.I just downloaded Boost 1.47 and found that
basic_datagram_socketinheritsnon_blocking()frombasic_socket. It looks to me like you don’t actually have Boost 1.47.