From 851e506d1fedfe913e3f16f25126778a08b81cce Mon Sep 17 00:00:00 2001 From: Valentin Spiroski Date: Sun, 4 Feb 2024 23:17:02 +0100 Subject: [PATCH] run Method, implement from Runnable --- src/main/java/ClientHandler.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/ClientHandler.java b/src/main/java/ClientHandler.java index 200dccf..6711e84 100644 --- a/src/main/java/ClientHandler.java +++ b/src/main/java/ClientHandler.java @@ -27,8 +27,14 @@ public class ClientHandler implements Runnable { @Override public void run() { - // TODO Auto-generated method stub - + try { + fromClientReader = new BufferedReader(new InputStreamReader(connectionToClient.getInputStream())); + toClientWriter = new PrintWriter(new OutputStreamWriter(connectionToClient.getOutputStream())); + chatServer.broadcastMessage(name + " connected."); + + } catch (IOException e) { + e.printStackTrace(); + } }