protected void terminateTerminals() {
		List<TerminalSession> terminals;
		synchronized (this.terminals) {
			terminals = List.copyOf(this.terminals);
			this.terminals.clear();
		}
		for (TerminalSession term : terminals) {
			CompletableFuture.runAsync(() -> {
				try {
					term.terminate();
				}
				catch (Exception e) {
					Msg.error(this, "Could not terminate " + term + ": " + e);
				}
			});
		}
	}
Create a handler

<p>
Note it is common for this to be constructed by a TCP <em>client</em>.

@param plugin the Trace RMI plugin
@param socket the socket to the back-end debugger
@throws IOException if there is an issue with the I/O streams
Ghidra/Debug/Debugger-rmi-trace/src/main/java/ghidra/app/plugin/core/debug/service/tracermi/TraceRmiHandler.java