| Home | Libraries | People | FAQ | More

##### basic_socket::non_blocking (3 of 3 overloads)

Sets the non-blocking mode of the socket.

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

###### Parameters

mode

  If `true`, the socket'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.

ec

  Set to indicate what error occurred, if any.

###### Remarks

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`.