Io-Socket-Ip

IO::Socket::IP(3p) Perl Programmers Reference Guide IO::Socket::IP(3p)

Io-Socket-Ip

IO::Socket::IP(3p) Perl Programmers Reference Guide IO::Socket::IP(3p) # IO::Socket::IP(3p) Perl Programmers Reference Guide IO::Socket::IP(3p) NNAAMMEE # "IO::Socket::IP" - Family-neutral IP socket supporting both IPv4 and IPv6 SSYYNNOOPPSSIISS # use IO::Socket::IP; my $sock = IO::Socket::IP->new( PeerHost => "www.google.com", PeerPort => "http", Type => SOCK_STREAM, ) or die "Cannot construct socket - $@"; my $familyname = ( $sock->sockdomain == PF_INET6 ) ? "IPv6" : ( $sock->sockdomain == PF_INET ) ? "IPv4" : "unknown"; printf "Connected to google via %s\n", $familyname; DDEESSCCRRIIPPTTIIOONN # This module provides a protocol-independent way to use IPv4 and IPv6 sockets, intended as a replacement for IO::Socket::INET. ...