Hi Eugene,
--- "Alterman, Eugene" <Eugene.Alterman@Staples.com> wrote:
> Exposing a lower layer via a public method is IMHO a flaw in the
> design that
> violates layering. My guess is that it is only used for connection
> establishment (connect/accept).
Also to allow access to socket options, to get the remote and local
endpoints, bind the socket to a specific interface, etc. I see access
to these as essential.
> After a connection has been
> established a
> lower layer is not supposed to be accessed directly, and
> providing unrestricted access to it is potentially unsafe.
The stack of layers design is designed as a compile-time equivalent of
ACE's ACE_Task/ACE_Module/ACE_Stream idea. The
next_layer()/lowest_layer() functions and associated typedefs are
provided to allow efficient access to the various layers. In this sense
it's not really intended as an information-hiding abstraction.
Is there a way to reconcile both safety and the need to access some of
the socket's functionality directly? I don't know, so it may be worth
bringing up in the boost review.
Cheers,
Chris
|