I tried using following code to read the number of available bytes in the socket (on the server side) and the variable packet_bytes
does not do anything. I was expecting the number of bytes used by the packet to be read into packet_bytes
but that doesn't seem to work.
std::size_t packet_bytes = 0;
socket_.async_read_some(boost::asio::buffer(data_, max_length),
boost::bind(&session::handle_read, this,
boost::asio::placeholders::error,
packet_bytes));
I also tried std::size_t packet_bytes = socket_.available();
and that didn't return anything either. This is the entire code.