I am new to boost and I have tried boost :: asio. The problem is that when I configure some parameters, I always get the "Bad File Descriptor" error / exception message (I need to make it non-blocking). Even here it fails:
#include <boost/asio.hpp>
using boost::asio::ip::tcp;
int main( )
{
boost::asio::io_service io_service;
tcp::socket socket( io_service );
boost::asio::socket_base::non_blocking_io option(true);
socket.io_control( option );
return 0;
}
At runtime, this pops up:
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
what(): Bad file descriptor
Which is disappointing since I tried everything. OS is Linux x64, if that matters.
source
share