So, the code I started with and which works (with important caveats below)
int reply_length = boost::asio::read(*m_socketptr, boost::asio::buffer((char*)reply, 6));
This works, I get the header which I then decode and follow up with another read which gets me my message and then I loop back to the top and read another header. This pegs my CPU at 100% so I want to replace the header read above with something like the following:
m_socketptr->async_read_some(boost::asio::buffer(m_data, 6), boost::bind(&CSListener::handleRead, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
or
boost::asio::async_read(*m_socketptr, boost::asio::buffer(m_data, 6), boost::bind(&CSListener::handleRead, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));
Either way I code it, the handleRead method is not ever getting called. Help!?
TIA