I've found the random port was not working reliably on my home desktop. I didn't have a problem on my laptop strangely. I've solved this elsewhere in the evasion-common get_free_port() which I've adapted and would like to contribute here.