From 3b2aaa4d7cfce4e937057f1aa6bb2b41d2838248 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Sun, 24 Nov 2013 09:26:23 +0200 Subject: ChatServer: add a connections list Add a list of connections to the ChatServer. A connection gets added there on generation (but so far not much more). --- src/Server/ChatServer.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/Server/ChatServer.java b/src/Server/ChatServer.java index fb51502..9e94794 100644 --- a/src/Server/ChatServer.java +++ b/src/Server/ChatServer.java @@ -1,14 +1,18 @@ package Server; import java.net.*; import java.io.*; +import java.util.LinkedList; public class ChatServer { private ServerSocket service; + private LinkedList connections; + public static final int portNum = 6667; ChatServer() throws IOException { this.service = new ServerSocket(portNum); + this.connections = new LinkedList(); } public static void main(String[] args) throws IOException @@ -30,6 +34,7 @@ public class ChatServer { soc = server.service.accept(); Connection con = new Connection(soc); + server.connections.add(con); con.start(); } } catch (IOException e) -- cgit v1.2.3