Boost logo

Boost :

From: me22 (me22.ca_at_[hidden])
Date: 2006-06-26 00:36:43


On 6/21/06, Christopher Kohlhoff <chris_at_[hidden]> wrote:
> Hello all,
>
> As previously discussed, in this version I have included some
> prototype iostreams and streambuf support. Feedback on this
> would be appreciated.
>
>From http://asio.sourceforge.net/boost_asio_0_3_7/libs/asio/doc/examples/httpclient_sync_client_cpp.html
:

    boost::asio::streambuf request;
    std::ostream request_stream(&request);
    request_stream << "GET " << argv[2] << " HTTP/1.0\r\n";
    request_stream << "Host: " << argv[1] << "\r\n";
    request_stream << "Accept: */*\r\n";
    request_stream << "Connection: close\r\n\r\n";

    // Send the request.
    boost::asio::write(socket, request);

What advantage is the boost::asio::streambuf providing here? I don't
see a different between it and just using a stringstream and sending
the .str().

> An example use of the iostreams classes in a client program can
> be seen here:
>
> <http://asio.sourceforge.net/boost_asio_0_3_7/libs/asio/doc/examples/iostreams_daytime_client_cpp.html>
>
Very nice.

Just took a quick peek,
~ Scott McMurray


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk