Hi,

For disk i/o, you might want to give a look at this thread:
http://osdir.com/ml/lib.boost.asio.user/2006-11/msg00002.html

Cheers,

Lau

On Mon, Jun 1, 2009 at 1:12 PM, Zachary Turner <divisortheory@gmail.com> wrote:
I've been reading over the documentation for Boost.Asio and as far as I can tell the documentation makes no mention whatsoever about using Asio for anything other than sockets programming.  Suppose I wanted to implemented a simple file transfer client (I say client because the server will not be in C++) that reads files off of the disk and sends them to the server.  I'd like to do it asynchronously.  What would be the basic steps needed to do this with Boost.Asio, if it is indeed even possible?  I'd specifically like it to use I/O Completion Ports on Windows if possible, and whatever on Linux.  I'd like to be able to configure the number of worker threads on the backend, so that for example I can read from N files at once, or from N different locations in the same file.  I'd also like to have a single "controller" thread that receives all the events regarding when reads or writes complete, so that I don't have to use any kind of locking to synchronize things.

As a final "nice-to-have", I'd like to be able to plug my own types of "actions" into the model, things that aren't really I/O but that I still want to execute asynchronously that would sit in between a completed disk read and the initiation of writing that same data to the socket.  Think, for example, of encrypting the file before sending.  I don't want to block on the encryption, so it would be nice if I could do that asynchronously and still be notified of its completion through the same interface.  I know I can do all this directly in windows (which is the only system api i'm intimately familiar with) via IOCP, so I'm hoping something similar can be achieved with Boost.Asio.

Thanks

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users