static int findFreePortAbove(int _port) { int port = _port; if (portIsFree(port)) ret port; if (port < 1024) port = 1024; while (port < 65536) if (portIsFree(port)) ret port; else port++; fail("No free port found above " + _port); }