public void leaveChat(String address) { try { udpHandler.leaveGroup(address); } catch (IOException e) { System.out.println("Client: leaveChat: error in leaving chat = " + address); e.printStackTrace(); // Something goes wrong, break client killClient(); } }
private void killClient() { System.out.println("Client: break client"); tcpHandler.close(); udpHandler.close(); }