From 5adf67da98d69bf15023f9980ac742ca0cf397a3 Mon Sep 17 00:00:00 2001 From: Paul Kattenborn Date: Wed, 7 Feb 2024 00:28:20 +0100 Subject: [PATCH] =?UTF-8?q?refactoring:=20Einr=C3=BCcken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/ChatServer.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/ChatServer.java b/src/main/java/ChatServer.java index c359642..c647fe6 100644 --- a/src/main/java/ChatServer.java +++ b/src/main/java/ChatServer.java @@ -11,17 +11,17 @@ public class ChatServer { public ChatServer(int port) { clients = new CopyOnWriteArrayList<>(); - + try { serverSocket = new ServerSocket(port); System.out.println("Started ChatServer on port " + port); - - while(true) { + + while (true) { System.out.println("waiting for new Client..."); - Socket connectionToClient = serverSocket.accept(); - ClientHandler client = new ClientHandler(this, connectionToClient); - clients.add(client); - System.out.println("Accepted new Client"); + Socket connectionToClient = serverSocket.accept(); + ClientHandler client = new ClientHandler(this, connectionToClient); + clients.add(client); + System.out.println("Accepted new Client"); } } catch (IOException e) { e.printStackTrace();