public void close() { try { client.close(); } catch (IOException e) { throw new RuntimeException("Could not close connection", e); } }
@Override public void run() { try { boolean quit = false; do { quit = mainMenu(); } while (!quit); } catch (Exception e) { e.printStackTrace(System.out); } finally { stdout.println("Closing connection to domain controller"); try { client.close(); } catch (IOException e) { e.printStackTrace(); } } stdout.println("Done"); }