MCPcopy Index your code
hub / github.com/RustPython/RustPython / arbitrary_address

Function arbitrary_address

Lib/multiprocessing/connection.py:70–82  ·  view source on GitHub ↗

Return an arbitrary free address for the given family

(family)

Source from the content-addressed store, hash-verified

68#
69
70def arbitrary_address(family):
71 '''
72 Return an arbitrary free address for the given family
73 '''
74 if family == 'AF_INET':
75 return ('localhost', 0)
76 elif family == 'AF_UNIX':
77 return tempfile.mktemp(prefix='sock-', dir=util.get_temp_dir())
78 elif family == 'AF_PIPE':
79 return tempfile.mktemp(prefix=r'\\.\pipe\pyc-%d-%d-' %
80 (os.getpid(), next(_mmap_counter)), dir="")
81 else:
82 raise ValueError('unrecognized family')
83
84def _validate_family(family):
85 '''

Callers 2

__init__Method · 0.85
PipeFunction · 0.85

Calls 2

nextFunction · 0.85
mktempMethod · 0.80

Tested by

no test coverage detected