Boost logo

Boost Users :

Subject: [Boost-users] ASIO async I/O with iostream?
From: Jay Sprenkle (jsprenkle_at_[hidden])
Date: 2009-12-09 13:49:24

Good afternoon all,

I'm interested in writing a program using asio. I'm new to both boost and
asio. Is it possible to use async I/O with streams?

A stream is a good method for what I'm interested in doing but I don't see
how to make it work.
What I've got so far:
A class using event driven async I/O. The class parses the data into
variable arbitrary sized messages.

I read from the tcp socket into a buffer, then create a stream from the
buffer, then deserialize the data from the stream.

unsigned char buffer[1024];

      // connect receive event
        boost::bind( &TcpConnection::receive, this,

I'd like to be able to skip the buffer and just read directly to the stream
with an event to notify me of the arrival of data.


Cause united breaks guitars

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at