MCPcopy
hub / github.com/aio-libs/aiohttp / find_port

Function find_port

benchmark/async.py:16–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14
15
16def find_port():
17 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
18 s.bind(('localhost', 0))
19 host, port = s.getsockname()
20 s.close()
21 return host, port
22
23
24profiler = cProfile.Profile()

Callers 1

runFunction · 0.85

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected