## to the top of X11/Protocol/Connection/INETSocket.pm

our $SOCKET_CLASS;

$SOCKET_CLASS
    = ((eval { require IO::Socket::INET6 })
       ? "IO::Socket::INET6"
       : do { require IO::Socket::INET; "IO::Socket::INET"; })
    unless (defined ($SOCKET_CLASS));

## the ‘open’ function is then to be changed as follows:

#      my($host, $dispnum) = @_;
# -    my($sock) = IO::Socket::INET->new('PeerAddr' => $host,
# +    my($sock) = $SOCKET_CLASS->new   ('PeerAddr' => $host,
#  				      'PeerPort' => 6000 + $dispnum,
#  				      'Type' => SOCK_STREAM(),
#  				      'Proto' => "tcp");
#      croak "Can't connect to display `$host:$dispnum': $!" unless $sock;
