private static void listen(int port) {

		if (!GhidraScriptEditorPreferences.isScriptEditorEnabled()) {
			EclipseMessageUtils.info(
				Activator.PLUGIN_ID + " Script Editor port listening is disabled in preferences.");
			return;
		}

		if (port == -1) {
			EclipseMessageUtils.info(Activator.PLUGIN_ID +
				" Script Editor port listening is disabled, port not set in preferences.");
			return;
		}

		try {
			serverSocket = new ServerSocket(port);
			EclipseMessageUtils.info(
				Activator.PLUGIN_ID + " Script Editor is listening on port " + port);
			Activator.getDefault().registerCloseable(serverSocket);
		}
		catch (IOException e) {
			EclipseMessageUtils.showErrorDialog(Activator.PLUGIN_ID + " Script Editor",
				"Failed to listen for connections on port " + port +
					".  The Script Editor features will be disabled until a valid port is selected in preferences.");
			return;
		}

		new Thread(new SocketSetupRunnable(serverSocket)).start();
	}
Listens for socket connections on the given port.  If there is a problem listening,
a popup is displayed for the user.

@param port The port to listen on.  If the port is -1, this method doesn't do anything.
GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/src/main/java/ghidradev/ghidrascripteditor/ScriptEditorInitializer.java