Boost logo

Boost :

From: Jeremy Maitin-Shepard (jbms_at_[hidden])
Date: 2005-12-15 18:32:21


Christopher Kohlhoff <chris_at_[hidden]> writes:

> [snip]

> I don't think that the need to pass a demuxer to the socket
> constructor is conceptually difficult to explain. It's there for
> the asynchronous operations, if and when you need them.

> I also do not agree that it is onerous to have to pass the
> demuxer to the constructor, or to pass it wherever it's needed
> in the program. You can make it a global, declare a new one for
> each use, or even use one associated with an existing object, as
> in:

> stream_socket s(my_acceptor.demuxer());

> Therefore I stand by my design choices as the best balance
> between usability, functionality and flexibility.

It seems that a possible solution is to provide a `dummy' demuxer that
simply makes asynchronous operations fail. This `dummy' demuxer could
then be the default parameter to the socket constructors, thus
eliminating the need to specify a demuxer for synchronous-only use.

It seems that this would indeed clean up the interface for
synchronous-only use.

> [snip]

-- 
Jeremy Maitin-Shepard

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk