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

Click here to view the latest version of this page.
PrevUpHomeNext
basic_raw_socket::io_control (1 of 2 overloads)

Inherited from basic_socket.

Perform an IO control command on the socket.

void io_control(
    IoControlCommand & command);

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

Parameters

command

The IO control command to be performed on the socket.

Exceptions

boost::system::system_error

Thrown on failure.

Example

Getting the number of bytes ready to read:

boost::asio::ip::tcp::socket socket(io_service);
...
boost::asio::ip::tcp::socket::bytes_readable command;
socket.io_control(command);
std::size_t bytes_readable = command.get();

PrevUpHomeNext