Boost logo

Boost :

From: Rob Lievaart (Rob.Lievaart_at_[hidden])
Date: 2003-10-28 02:55:03


Hi Jessie,

> Well, I personally prefer a "large" socket exception
> hierarchy.
I do not have any "killer" arguments for or against it, I just
thought I'd mention my thoughts.

> > - Why the split into basic_socket and basic_socket implementation,
> > what is the use of that? All the members of basic_socket_impl
> > are virtual, but I don't see any case of wanting to replace this
> > with something else at runtime.
> > It looks to me like you are using it to share implementation between
> > basic_socket and server_socket, but wouldn't it be easier to
> > do this using a common baseclass. I could have missed it but
> > I see no use for the seperate implementation class.
>
>
> Well, there may be two implementations available in the system (normal
> socket API and WinSock on Windows, for example).
> If it isn't a member, then a base class can be used, as you
> said. But then
> the implementation needs to be a template parameter in the
> basic_socket
> class to accomodate normal sockets and WinSock sockets. I'll
> also look into this.
Right, I allways use the BSD socket interface, so I forgot about
the other one.

> > - I see quite a few ifdefs related to the socklen_t type,
> > e.g.:
> >
> > #if defined( WIN32 )
> > int _NameLength = sizeof( address_type::native_t );
> > #else
> > socklen_t _NameLength = sizeof( address_type::native_t );
> > #endif
> >
> > These could be replaced by a single typedef somewhere. Makes
> > the code a lot simpler.
> >
>
> I only saw two of these, but you have a valid point. I'll
> also do this in
> one typedef.
Well, I didn't count them, I also saw (at least one) other that is around
a system call, but the only difference between the WIN32 and the other
version is a typecase either to socklen_t* and int* of one of the
parameters.

Cu,

Rob.


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