Re: [asio-users] Serial Port and async_read_until: how to create the iostream
Brought to you by:
chris_kohlhoff
|
From: Igor R <boo...@gm...> - 2010-04-20 12:32:23
|
> while using the async_read_until function with the additional parameter > between the buffer and the handler, the delim char, doesn't: > async_read_until(serial_port, > boost::asio::buffer( in_message, > MAX_MESSAGE_SIZE ), > '\n', > boost::bind( &serial_bytes_read, > boost::asio::placeholders::error, > boost::asio::placeholders::bytes_transferred ) > ); > > giving me > error: no matching function for call to > ‘async_read_until(boost::asio::serial_port&, > boost::asio::mutable_buffers_1, char, boost::_bi::bind_t<void, void > (*)(const boost::system::error_code&, int), > boost::_bi::list2<boost::arg<1> (*)(), boost::arg<2> > (*)()> >)’ This is because async_read_until requires asio::streambuf as the 2nd parameter: http://www.boost.org/doc/libs/1_42_0/doc/html/boost_asio/reference/async_read_until.html |