summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDor Bivas <dor1_b@walla.com>2013-12-21 18:17:46 +0200
committerDor Bivas <dor1_b@walla.com>2013-12-21 18:17:46 +0200
commitade2b3793fb7d588078631a02e4f25e237c7824c (patch)
treeb14bd9b20020fe406ff0fe98f211a956a3c42bbe
parent0dca678144d24f7bd5c82bd6a4e4bb8b7624e107 (diff)
server: expose interfrace for connections list
-rw-r--r--src/Server/ChatServer.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Server/ChatServer.java b/src/Server/ChatServer.java
index 0e6e8a8..9f9beb9 100644
--- a/src/Server/ChatServer.java
+++ b/src/Server/ChatServer.java
@@ -2,6 +2,7 @@ package Server;
import java.net.*;
import java.io.*;
import java.util.LinkedList;
+import java.util.Iterator;
public class ChatServer
{
@@ -10,6 +11,16 @@ public class ChatServer
public static final int portNum = 6667;
+ public void connectionRemove(Connection con)
+ {
+ this.connections.remove(con);
+ }
+
+ public Iterator<Connection> getConnectionIterator()
+ {
+ return this.connections.iterator();
+ }
+
ChatServer() throws IOException {
this.service = new ServerSocket(portNum);
this.connections = new LinkedList<Connection>();