From: Arkadiy Vertleyb (vertleyb_at_[hidden])
Date: 2005-12-15 21:16:23
"Christopher Kohlhoff" <chris_at_[hidden]> wrote
> With asio, I was hoping to make asynchronous operations as
> natural and easy to use as possible, compared to their
> synchronous counterparts.
I am afraid this might be impossible :-( People usually make/think about
"1 2 3 4" is much more intuitive than "1 2(call 3 when finished(and 3 will
> > I just want to point out that async reading and writing could
> > be a function of an async I/O demuxer and not the socket
> > itself. The socket could be passed to the demuxer and not
> > vice versa.
> The above design is something I can fundamentally disagree with
> ;) That sort of design, in my opinion, relegates asynchronous
> operations to "second class citizens".
Why should a read/write operation necessarily be a member function? Isn't
IO just moving bytes from one location to another where neither source nor
destination is primary?
Consider getline() ftom <string> or streaming operations. All of them are
namespace-level functions. There is nothing wrong with having
namespace-level functions in C++. We are not in Java... We don't have to
be too object-oriented :-)
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk