summaryrefslogtreecommitdiff
path: root/src/Server
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir@cohens.org.il>2013-11-24 09:26:23 +0200
committerTzafrir Cohen <tzafrir@cohens.org.il>2013-11-24 09:26:23 +0200
commit3b2aaa4d7cfce4e937057f1aa6bb2b41d2838248 (patch)
treeb41659b15f7f976db3399272a92f899e22b7d731 /src/Server
parentbb24ed35199f529e9ddd88467834d36f56aa3682 (diff)
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).
Diffstat (limited to 'src/Server')
-rw-r--r--src/Server/ChatServer.java5
1 files changed, 5 insertions, 0 deletions
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<Connection> connections;
+
public static final int portNum = 6667;
ChatServer() throws IOException {
this.service = new ServerSocket(portNum);
+ this.connections = new LinkedList<Connection>();
}
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)