| Home | Libraries | People | FAQ | More

##### posix::basic_descriptor::io_control (1 of 2 overloads)

Perform an IO control command on the descriptor.

    template<
        typename IoControlCommand>
    void io_control(
        IoControlCommand & command);

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

###### Parameters

command

  The IO control command to be performed on the descriptor.

###### Exceptions

boost::system::system_error

  Thrown on failure.

###### Example

Getting the number of bytes ready to read:

    boost::asio::posix::stream_descriptor descriptor(io_service);
    ...
    boost::asio::posix::stream_descriptor::bytes_readable command;
    descriptor.io_control(command);
    std::size_t bytes_readable = command.get();