vrepper icon indicating copy to clipboard operation
vrepper copied to clipboard

Find actully free port to use, instead of simply random and depends on luck

Open CrazyHeex opened this issue 7 years ago • 0 comments

fix:

def find_free_port_to_use(self): #https://stackoverflow.com/questions/1365265/on-localhost-how-do-i-pick-a-free-port-number
    with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s:
        s.bind(('', 0))
        return s.getsockname()[1]

CrazyHeex avatar Feb 03 '18 21:02 CrazyHeex