'Resolve address family for the socket.'

def _setAddressFamily(self):

    if abstract.isIPv6Address(self.interface):
        self.addressFamily = socket.AF_INET6
    elif abstract.isIPAddress(self.interface):
        self.addressFamily = socket.AF_INET
    elif self.interface:
        raise error.InvalidAddressError(self.interface, 'not    an    IPv4    or    IPv6    address.')
