|
|
@ -39,10 +39,10 @@ public class ChatServer { |
|
|
|
} |
|
|
|
// Methode, um eine Nachricht an alle verbundenen Clients zu senden |
|
|
|
public void broadcastMessage(String message) { |
|
|
|
System.out.println(message); |
|
|
|
if (message != null) { |
|
|
|
for (ClientHandler client : clients) { |
|
|
|
client.sendMessage(message); // Nachricht an jeden Client senden |
|
|
|
System.out.println(message); |
|
|
|
if (message != null) { |
|
|
|
for (ClientHandler client : clients) { |
|
|
|
client.sendMessage(message); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|