From 1ca86de8689d6b2702c23dbf46abdc27def1c83b Mon Sep 17 00:00:00 2001 From: Paul Kattenborn Date: Wed, 7 Feb 2024 01:13:32 +0100 Subject: [PATCH] refactoring: Kommentare --- src/main/java/ChatServer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/ChatServer.java b/src/main/java/ChatServer.java index b118b63..0c60774 100644 --- a/src/main/java/ChatServer.java +++ b/src/main/java/ChatServer.java @@ -37,22 +37,22 @@ public class ChatServer { } } - - public void broadcastMessage(String message) { + // 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); + client.sendMessage(message); // Nachricht an jeden Client senden } } } public static void main(String[] args) { - new ChatServer(3141); + new ChatServer(3141); // ChatServer auf Port 3141 starten (eventuell den Port flexibler noch wählen? falls belegt) } - + // Methode, um einen Client aus der Liste der verbundenen Clients zu entfernen public void removeClient(ClientHandler client) { clients.remove(client); }