Browse Source

copyOnWriteArrayList

remotes/origin/feature/client/make-input-field-buttons-interactive^2
Paul Kattenborn 11 months ago
parent
commit
7970faab71
  1. 3
      src/main/java/ChatServer.java

3
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<ClientHandler> clients;
public ChatServer(int port) {
clients = new CopyOnWriteArrayList<>();
try {
serverSocket = new ServerSocket(port);
System.out.println("Started ChatServer on port " + port);

Loading…
Cancel
Save