[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: webpage for ipv6 programmers






On Wed, 4 Feb 2009, Niall O'Reilly wrote:

On Tue, 2009-02-03 at 13:49 +0100, Gert Doering wrote:
but there's better ways,
like using IO::Socket::INET6 which will nicely handle all the details
for
you.

	IIRC (and it's been a while), that module indeed gives your
	Perl application access to the IPv6 network but doesn't
	allow the app to be IP-version-agnostic.  Is there an
	abstraction layer which allows the app not to care about
	what network layer is in use?

Using Socket6 module already gives you ability to write IP-ersion agnostic application. You have access to getaddrinfo(), getnameinfo() and gai_strerror which allows you to write ip version agnostic code.

IO::Socket::INET6 is a generalisation of IO::Socket::INET to be IP version indepenedent. (Of course it allows accessing IPv6 specific elements like scope or flow).

e.g.:
$sock= IO::Socket::INET6->new (PeerAddr => 'www.6deploy.org',
                               PeerPort => 'http(80)',
                               Multihomed => 1,
                               Proto => 'tcp');

This should not care about the IP version.....


Best Regards,

		Janos