diff --git a/src/main/java/ClientHandler.java b/src/main/java/ClientHandler.java index 6711e84..fe885bd 100644 --- a/src/main/java/ClientHandler.java +++ b/src/main/java/ClientHandler.java @@ -32,6 +32,11 @@ public class ClientHandler implements Runnable { toClientWriter = new PrintWriter(new OutputStreamWriter(connectionToClient.getOutputStream())); chatServer.broadcastMessage(name + " connected."); + String message = fromClientReader.readLine(); + while (message!=null) { + chatServer.broadcastMessage(name + ": " + message); + message = fromClientReader.readLine(); + } } catch (IOException e) { e.printStackTrace(); }