diff --git a/src/main/java/ChatServer.java b/src/main/java/ChatServer.java index e868615..dc94664 100644 --- a/src/main/java/ChatServer.java +++ b/src/main/java/ChatServer.java @@ -3,12 +3,15 @@ import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; public class ChatServer { private ServerSocket serverSocket; private List clients; public ChatServer(int port) { + clients = new CopyOnWriteArrayList<>(); + try { serverSocket = new ServerSocket(port); System.out.println("Started ChatServer on port " + port);