public synchronized boolean connect() throws NotConnectedException {
		connectCancelled = false;

		if (serverHandle != null) {
			if (verifyConnection()) {
				return true;
			}
		}

		lastConnectError = null;
		try {
			try {
				serverHandle = ClientUtil.connect(server);
			}
			catch (CancelledException e) {
				// ignore
				Msg.debug(this, "Server connect cancelled by user");
			}
			unexpectedDisconnect = false;
			if (serverHandle != null) {
				Msg.info(this, "Connected to Ghidra Server at " + serverInfoStr);
				currentUser = serverHandle.getUser();
				fireStateChanged();

				checkPasswordExpiration();

				return true;
			}

			// Connect operation cancelled by the user
			connectCancelled = true;
			return false;
		}
		catch (LoginException e) {
			Msg.showError(this, null, "Server Error",
				"Server access denied (" + serverInfoStr + ").");
			lastConnectError = e;
		}
		catch (GeneralSecurityException e) {
			Msg.showError(this, null, "Server Error",
				"Server access denied (" + serverInfoStr + "): " + e.getMessage());
			lastConnectError = e;
		}
		catch (SocketTimeoutException | java.net.ConnectException | java.rmi.ConnectException e) {
			Msg.showError(this, null, "Server Error",
				"Connection to server failed (" + server + ").");
			lastConnectError = e;
		}
		catch (java.net.UnknownHostException | java.rmi.UnknownHostException e) {
			Msg.showError(this, null, "Server Error",
				"Server Not Found (" + server.getServerName() + ").");
			lastConnectError = e;
		}
		catch (RemoteException e) {
			String msg = e.getMessage();
			Throwable t = e;
			while ((t = t.getCause()) != null) {
				String err = t.getMessage();
				msg = err != null ? err : t.toString();
				lastConnectError = t;
			}
			Msg.showError(this, null, "Server Error",
				"An error occurred on the server (" + serverInfoStr + ").\n" + msg, e);
		}
		catch (IOException e) {
			String err = e.getMessage();
			if (err == null && (e instanceof EOFException)) {
				err = "Ghidra Server process may have died";
			}
			String msg = err != null ? err : e.toString();
			Msg.showError(this, null, "Server Error",
				"An error occurred while connecting to the server (" + serverInfoStr + ").\n" + msg,
				e);
		}
		throw new NotConnectedException("Not connected to repository server", lastConnectError);
	}
Attempt to connect or re-connect to the server.
@return true if connect successful, false if cancelled by user
@throws NotConnectedException if connect failed (error will be displayed to user)
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/RepositoryServerAdapter.java