Boost logo

Boost :

From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2005-08-20 04:10:47

Hi Dave,

--- Dave Gomboc <dave_at_[hidden]> wrote:
> Treating synchronous and asynchronous differently here seems less
> generic than always using
> template <typename Handler>
> void operation(parameters, Handler handler);
> Would it be bad to do it this way (possibly with a synchronous
> handler defaulted?)

Sorry, I wasn't really clear before. The presence or not of the handler
parameter is the difference in the function *signatures*. How the
function actually behaves is quite different (a synchronous call blocks
the calling thread, an asynchronous call never blocks). It is not the
handler parameter that determines whether the operation is synchronous
or asynchronous; the handler is just the function that is called when
the asynchronous operation completes.

> I don't perceive what's wrong with "write_to" and "read_from".

What do you think of my proposal in my email earlier today where
basically I use "read" and "write" for the operations that are in the
*Stream concepts (and so could equally apply to pipes, files and so
on), but retain "send" and "receive" (and "send_to" and "receive_from")
for operations that are specific to sockets?


Boost list run by bdawes at, gregod at, cpdaniel at, john at