| Home | Libraries | People | FAQ | More

##### basic_socket_acceptor::wait (2 of 2 overloads)

Wait for the acceptor to become ready to read, ready to write, or to have pending error conditions.

    void wait(
        wait_type w,
        boost::system::error_code & ec);

This function is used to perform a blocking wait for an acceptor to enter a ready to read, write or error condition state.

###### Parameters

w

  Specifies the desired acceptor state.

ec

  Set to indicate what error occurred, if any.

###### Example

Waiting for an acceptor to become readable.

    boost::asio::ip::tcp::acceptor acceptor(my_context);
    ...
    boost::system::error_code ec;
    acceptor.wait(boost::asio::ip::tcp::acceptor::wait_read, ec);