MCPcopy Create free account
hub / github.com/danvk/webdiff / random_port

Function random_port

webdiff/app.py:255–260  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

253
254
255def random_port():
256 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
257 sock.bind(('localhost', 0))
258 port = sock.getsockname()[1]
259 sock.close()
260 return port
261
262
263def pick_a_port(args, webdiff_config):

Callers 1

pick_a_portFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected