diff --git a/src/main/java/ChatClient.java b/src/main/java/ChatClient.java index dac4280..7eee6a4 100644 --- a/src/main/java/ChatClient.java +++ b/src/main/java/ChatClient.java @@ -61,6 +61,15 @@ public class ChatClient extends JFrame implements KeyListener { catch (Exception e) { JOptionPane.showMessageDialog(null, "Verbindung zum Server \"" + address + "\" fehlgeschlagen."); } + finally { + try { + connectionToServer.close(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } } @Override