diff options
author | Tzafrir Cohen <tzafrir@cohens.org.il> | 2013-11-24 09:26:23 +0200 |
---|---|---|
committer | Tzafrir Cohen <tzafrir@cohens.org.il> | 2013-11-24 09:26:23 +0200 |
commit | 3b2aaa4d7cfce4e937057f1aa6bb2b41d2838248 (patch) | |
tree | b41659b15f7f976db3399272a92f899e22b7d731 /src/Server | |
parent | bb24ed35199f529e9ddd88467834d36f56aa3682 (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.java | 5 |
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)
|