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 to view this page for the latest version.
posix::basic_stream_descriptor::non_blocking (3 of 3 overloads)

Inherited from posix::basic_descriptor.

Sets the non-blocking mode of the descriptor.

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


If true, the descriptor's synchronous operations will fail with boost::asio::error::would_block if they are unable to perform the requested operation immediately. If false, synchronous operations will block until complete.


Set to indicate what error occurred, if any.


The non-blocking mode has no effect on the behaviour of asynchronous operations. Asynchronous operations will never fail with the error boost::asio::error::would_block.