Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
posix::descriptor::native_non_blocking (2 of 3 overloads)

Sets the non-blocking mode of the native descriptor implementation.

void native_non_blocking(
    bool mode);

This function is used to modify the non-blocking mode of the underlying native descriptor. It has no effect on the behaviour of the descriptor object's synchronous operations.



If true, the underlying descriptor is put into non-blocking mode and direct system calls may fail with boost::asio::error::would_block (or the equivalent system error).



Thrown on failure. If the mode is false, but the current value of non_blocking() is true, this function fails with boost::asio::error::invalid_argument, as the combination does not make sense.