develooper Front page | perl.perl5.porters | Postings from June 2010

Re: [perl #75740] IPv6 support missing in perl5.10, perl5.12

Thread Previous | Thread Next
June 15, 2010 09:39
Re: [perl #75740] IPv6 support missing in perl5.10, perl5.12
Message ID:
Nicholas Clark wrote:
>  Socket is called Socket, not Socket4, and likewise NET::*, such as
>  IO::Socket::INET being that, not IO::Socket::INET4
>  Hence they're not just about IPv4, so *they* should be made to support
>  IPv6 too (and no new namespaces)

This is not quite right, but nearly so.  What the C level APIs do is:

* The term "socket" is just "socket", and applies not only to IPv4 and
  IPv4 but also to Unix-domain sockets and all other kinds of socket,
  including ones not yet invented.  Hence "socket4" or "socket6" would
  be a misnomer.

* The protocol/address family for IPv4 is labelled "INET".  Not "INET4";
  there is no "INET4".  This is for historical reasons, because the IPv4
  socket API predates us having to make that distinction.

* The protocol/address family for IPv6 is labelled "INET6".

I suggest we stick to that.  IO::Socket::INET is about IPv4 sockets,
and IO::Socket::INET6 is about IPv6 sockets.  If you want to use both
IPv4 and IPv6 together through one socket, you do that through an INET6
socket with an option flag saying that that's what you want to do, and
you end up seeing v4-mapped IPv6 addresses.  (This flag is standard and
was recently mentioned.)


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About