(family)
Return an arbitrary free address for the given family
Return an arbitrary free address for the given family
Return an arbitrary free address for the given family
def arbitrary_address(family):
    '''
    Return an arbitrary free address for the given family
    '''
    if family == 'AF_INET':
        return ('localhost', 0)
    elif family == 'AF_UNIX':
        # Prefer abstract sockets if possible to avoid problems with the address
        # size.  When coding portable applications, some implementations have
        # sun_path as short as 92 bytes in the sockaddr_un struct.
        if util.abstract_sockets_supported:
            return f"\0listener-{os.getpid()}-{next(_mmap_counter)}"
        return tempfile.mktemp(prefix='listener-', dir=util.get_temp_dir())
    elif family == 'AF_PIPE':
        return tempfile.mktemp(prefix=r'\\.\pipe\pyc-%d-%d-' %
                               (os.getpid(), next(_mmap_counter)), dir="")
    else:
        raise ValueError('unrecognized family')
def arbitrary_address ( family ) : if family == 'AF_INET' : return ( 'localhost' , 0 ) elif family == 'AF_UNIX' : # Prefer abstract sockets if possible to avoid problems with the address # size.  When coding portable applications, some implementations have # sun_path as short as 92 bytes in the sockaddr_un struct. if util . abstract_sockets_supported : return f"\0listener-{os.getpid()}-{next(_mmap_counter)}" return tempfile . mktemp ( prefix = 'listener-' , dir = util . get_temp_dir ( ) ) elif family == 'AF_PIPE' : return tempfile . mktemp ( prefix = r'\\.\pipe\pyc-%d-%d-' % ( os . getpid ( ) , next ( _mmap_counter ) ) , dir = "" ) else : raise ValueError ( 'unrecognized family' )