private static void waitUntilServerAvailable(final int basePort) throws IOException {

		RMIServerPortFactory portFactory = new RMIServerPortFactory(basePort);

		int maxTries = SERVER_STARTUP_MAXWAIT_MS / 200;
		int tries = 0;
		boolean success = false;
		try {
			while (tries++ < maxTries) {
				Thread.sleep(200);
				if (isServerRegistered(portFactory.getRMIRegistryPort()) &&
					canConnect(portFactory.getRMISSLPort())) {
					Msg.info(ServerTestUtil.class,
						"Successfully verified Ghidra Server registration and SSL port availability");
					success = true;
					return;
				}
			}
		}
		catch (InterruptedException e) {
			// ignore - stop waiting
		}
		finally {
			if (!success) {
				disposeServer();
			}
		}

		throw new IOException("Timed-out waiting for Ghidra Server to start");
	}
Start a server instance on the specified port.
This server must be disposed before attempting to create another.
@param dirPath server root directory
@param port RMI registry port, 0 indicates that default port should be used
@param authMode authentication mode (-1 for no authentication)
@param enableAltLoginName if true enable alternate login name
@param enableSSHAuthentication if true SSH authentication will be enabled
@param enableAnonymousAuthentication if true anonymous usage is allowed
@throws IOException
Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/server/remote/ServerTestUtil.java