
On 6/21/06, Christopher Kohlhoff <chris@kohlhoff.com> 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/httpclie... :
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:
Very nice. Just took a quick peek, ~ Scott McMurray