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

Method find_unused_port

tests/test_web_functional.py:36–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

34 gc.collect()
35
36 def find_unused_port(self):
37 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
38 s.bind(('127.0.0.1', 0))
39 port = s.getsockname()[1]
40 s.close()
41 return port
42
43 @asyncio.coroutine
44 def create_server(self, method, path, handler=None, ssl_ctx=None,

Callers 1

create_serverMethod · 0.95

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected