Browse Source

finally in run()

remotes/origin/feature/client/make-input-field-buttons-interactive
Valentin Spiroski 11 months ago
parent
commit
cc284a2262
  1. 14
      src/main/java/ClientHandler.java

14
src/main/java/ClientHandler.java

@ -39,6 +39,20 @@ public class ClientHandler implements Runnable {
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} finally {
//chatServer.removeClient(this);
chatServer.broadcastMessage(name + " disconnected.");
if (fromClientReader != null) {
try {
fromClientReader.close();
} catch (IOException e){
e.printStackTrace();
}
}
if (toClientWriter != null) {
toClientWriter.close();
}
} }
} }

Loading…
Cancel
Save