[Ns-developers] TCP and UDP layer refactoring

Tom Henderson tomh at tomh.org
Tue Jul 8 22:57:45 PDT 2008


Mathieu Lacage wrote:

> 
> 
>>> - When we *L4Protocol::CreateSocket(), it will give a socket that could 
>>> be bound in IPv4 or IPv6 so no need to add Udp6/Tcp6SocketFactory;
>> this is an interesting point, I think.  The SocketImpl classes can't 
>> have any explicit address family dependency because they are created 
>> before the family is known.  So I agree with your point.
> 
> I do not really understand that last point: why would you not know the
> family at this point ? The caller of the CreateSocket function knows
> what family it wants to get.
> 

(getting back to this thread)

If we make the SocketImpl class to be family independent, then when you 
create a socket, it can later become either a v4 or v6 socket depending 
on the addresses passed in.  Right now, this information is not known at 
socket creation time.

In a later post, you suggested that this may be a bad idea; that we may 
want to explicitly either pass an address family parameter to 
CreateSocket() or else have separate factories for address families? 
That would seem to imply in either case that we store in the socketimpl 
class some kind of flag to let it know what kind of addresses it may 
later accept.

Tom


More information about the Ns-developers mailing list