Inherited from basic_socket.
Perform an IO control command on the socket.
template< typename IoControlCommand> void io_control( IoControlCommand & command, std::error_code & ec);
This function is used to execute an IO control command on the socket.
The IO control command to be performed on the socket.
Set to indicate what error occurred, if any.
Getting the number of bytes ready to read:
std::experimental::net::ip::tcp::socket socket(io_context); ... std::experimental::net::ip::tcp::socket::bytes_readable command; std::error_code ec; socket.io_control(command, ec); if (ec) { // An error occurred. } std::size_t bytes_readable = command.get();