Boost logo

Boost Users :

Subject: [Boost-users] [boost::asio]about boost::asio::async_read_until
From: Ken zhang (kennir_at_[hidden])
Date: 2008-11-24 09:20:58


Hi Dear all

  I want use async_read_until for read stream from socket until EOF,but I
can't compile code below.

code:
        boost::asio::async_read_until(socket_,
stream_buffer_,boost::asio::transfer_all(),
            boost::bind(&http_connection::handle_read_response, this,

boost::asio::placeholders::error,boost::asio::placeholders::bytes_transferred));

stream_buffer is instance of boost::asio::streambuf

I got the error like:

d:\development\boost_1_36_0\boost\asio\impl\read_until.ipp(953) : error
C2664: "bool boost::asio::detail::transfer_all_t::operator
()<iterator>(const Error &,size_t)":Can't convert paramerater 2 from
"iterator" to "size_t"
        with
        [
            Error=iterator
        ]
        d:\development\tcphttpbridge\httpconnection.cpp(75):²Î¼û¶ÔÕýÔÚ±àÒëµÄº¯Êý Ä£ °å
ʵÀý»¯"void
boost::asio::async_read_until<boost::asio::ip::tcp::socket,std::allocator<_Ty>,boost::asio::detail::transfer_all_t,boost::_bi::bind_t<R,F,L>>(AsyncReadStream
&,boost::asio::basic_streambuf<> &,MatchCondition,ReadHandler,void *)"µÄÒýÓÃ
        with
        [
            _Ty=char,
            R=void,
            F=boost::_mfi::mf2<void,http_connection,const
boost::system::error_code &,size_t>,
            L=boost::_bi::list3<boost::_bi::value<http_connection
*>,boost::arg<1>,boost::arg<2>>,
            AsyncReadStream=boost::asio::ip::tcp::socket,
            MatchCondition=boost::asio::detail::transfer_all_t,

ReadHandler=boost::_bi::bind_t<void,boost::_mfi::mf2<void,http_connection,const
boost::system::error_code
&,size_t>,boost::_bi::list3<boost::_bi::value<http_connection
*>,boost::arg<1>,boost::arg<2>>>
        ]

-- 
Best Regards,
Ken


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net