rol.overload2.example"></a></span><a class="link" href="overload2.html#boost_asio.reference.basic_datagram_socket.io_control.overload2.example">Example</a>
          </h6>
<p>
            Getting the number of bytes ready to read:
          </p>
<pre class="programlisting">boost::asio::ip::tcp::socket socket(io_context);
...
boost::asio::ip::tcp::socket::bytes_readable command;
boost::system::error_code ec;
socket.io_control(command, ec);
if (ec)
{
  // An error occurred.
}
std::size_t bytes_readable = comm