Boost C++ Libraries

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

PrevUpHomeNext
basic_socket_acceptor::io_control (2 of 2 overloads)

Perform an IO control command on the acceptor.

template<
    typename IoControlCommand>
void io_control(
    IoControlCommand & command,
    boost::system::error_code & ec);

This function is used to execute an IO control command on the acceptor.

Parameters

command

The IO control command to be performed on the acceptor.

ec

Set to indicate what error occurred, if any.

Example

Getting the number of bytes ready to read:

boost::asio::ip::tcp::acceptor acceptor(my_context);
...
boost::asio::ip::tcp::acceptor::non_blocking_io command(true);
boost::system::error_code ec;
socket.io_control(command, ec);
if (ec)
{
  // An error occurred.
}

PrevUpHomeNext