|
Boost : |
From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2005-12-15 21:17:03
Hi Christopher,
--- christopher baus <christopher_at_[hidden]> wrote:
> There two sorts of asynchronous calls that can be made.
>
> The first is a "operation" which results in one trip through
> the dispatcher. For instance
> asio::socket_stream::write_some(). Internally these are stored
> in operation classes, hence the terminology.
>
> The second I'm calling a "request" which results in one or
> more "operations" to occur before the user handler is
> dispatched. For instance asio::async_write() calls
> asio::stream_socket::write_some() one or more times.
I've started using the term "composed operation", based on the
fact that these operations are composed of one or more other
operations.
However I'd like to point out that the distinction is not as
clear cut as between say asio::async_write() and
asio::stream_socket::async_write_some(). The asio::async_write()
function is actually implemented in terms of
Stream::async_write_some(), where Stream is a concept I have
defined.
This Stream concept is implemented by stream_socket, but also by
ssl::stream, buffered_read_stream and so on. It allows compile
time polymorphism, so that functions like asio::async_write()
can operate on any of these types. Furthermore, the
async_write_some() functions on some of these classes are
themselves composed operations, since they may call
async_write_some() on the underlying stream one or more times.
Cheers,
Chris
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk