/** * Interrupts {@link #doEvents()} or {@link #doEvents(long)}.<p> * <b>Can be called outside main thread.</b> */ public void interrupt() { invokeLater(() -> interrupted = true); }
invokeLater(() -> { try { client.connect(selector, new InetSocketAddress(addr, port)); } catch (IOException e) { invokeLater(connection::onDisconnect);