|
@ -32,6 +32,11 @@ public class ClientHandler implements Runnable { |
|
|
toClientWriter = new PrintWriter(new OutputStreamWriter(connectionToClient.getOutputStream())); |
|
|
toClientWriter = new PrintWriter(new OutputStreamWriter(connectionToClient.getOutputStream())); |
|
|
chatServer.broadcastMessage(name + " connected."); |
|
|
chatServer.broadcastMessage(name + " connected."); |
|
|
|
|
|
|
|
|
|
|
|
String message = fromClientReader.readLine(); |
|
|
|
|
|
while (message!=null) { |
|
|
|
|
|
chatServer.broadcastMessage(name + ": " + message); |
|
|
|
|
|
message = fromClientReader.readLine(); |
|
|
|
|
|
} |
|
|
} catch (IOException e) { |
|
|
} catch (IOException e) { |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
} |
|
|
} |
|
|