Hi All,
Thanks to Igor's pointing to streambuf I realized availability of stream operations.
I think for many newbies, stream examples would be easier to understand/reuse.
I found the very simple daytime_client and daytime_server examples useful.
(Examples could be reordered to start with simpler ones.)
Are there any other asio examples using streams?
If the contributors could add stream versions of chat server and client examples that would be great.

I guess using streams is somewhat less efficient, is that correct? (since you have more control on the buffer without streams.)

Best regards,
Ozgur (Oscar) Ozturk
www.DrOzturk.com
Phone: +1 (908) DROZGUR
i.e,        +1 (908) 376-9487


On Tue, Jul 21, 2009 at 4:28 PM, Igor R <boost.lists@gmail.com> wrote:
> I tried to use the same string as buffer for both async_read_some and async_write

Who will allocate the buffer for the read operation? socket's
async_read_some() doesn't know to do this alone.

> I guess the string can not be treated as a mutable buffer, so maybe I should
> keep the original char * buffer for async_read_some and use the string only
> for outputting with async_write. Is that right?
> (or any other recommendation?)

Why wouldn't you use asio::streambuf? You've a set of functions that
async.read/write from/to it, and it grows automatically. You can see
relevant examples in asio docs.
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users