
With this overload: http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/reference/async_rea... ...you can implement any condition you wish.
Hello List, I get a compiling error: error: no matching function for call to 'async_read_until(boost::asio::basic_stream_socket<boost::asio::ip::tcp, boost::asio::stream_socket_service<boost::asio::ip::tcp> >&, boost::asio::streambuf&, <unresolved overloaded function type>, boost::_bi::bind_t<void, boost::_mfi::mf2<void, xmpp::client, const boost::system::error_code&, unsigned int>, boost::_bi::list3<boost::_bi::value<xmpp::client*>, boost::arg<1> (*)(), boost::arg<2> (*)()> >)' When I have the following: boost::asio::async_read_until( socket_, streambuf_, read_condition, boost::bind( &client::handle_read, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred ) ); And typedef boost::asio::buffers_iterator< boost::asio::streambuf::const_buffers_type> iterator; std::pair< iterator, bool
read_condition( iterator begin, iterator end ) { boost::asio::ip::tcp::socket::receive_buffer_size option; socket_.get_option(option); if((end - begin) >= option.value()) { return std::make_pair(end,true); } while(begin != end) { if(*begin++ == '>') { return std::make_pair(begin,true); } } return std::make_pair(end,false); }
So why am I getting <unresolved overloaded function type>? Regards, Etienne