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

Click here to view the latest version of this page.
basic_socket_acceptor::native_non_blocking (3 of 3 overloads)

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

boost::system::error_code native_non_blocking(
    bool mode,
    boost::system::error_code & ec);

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



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


Set to indicate what error occurred, if any. 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.