Hello,

I have a std::istream that I pass into a function that calls async_write. Currently here is what I have:

void SerialClient::DoWrite( std::istream const& data )
{
  boost::asio::async_write(
    m_port,
    boost::asio::buffer( data.rdbuf() ),
    boost::bind( &SerialClient::WriteCompleted, this, boost::asio::placeholders::error )
    );
}

Obviously this does not compile. There is no overload of buffer() that takes a streambuf. How can I get asio to write out my stream?


---------
Robert Dailey