void () { try { try (Socket client = new Socket("127.0.0.1", portNumber)) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream(), "US-ASCII"))) { while (true) { String msg = reader.readLine(); if (msg == null || "TERM".equals(msg)) { return; } else if ("BREAK".equals(msg)) { if (helperLibLoaded) { triggerControlBreak(); } } else if ("STOP".equals(msg)) { System.exit(1); } } } } } catch (Exception ignored) { } }