diff --git a/cs654/proj1/KaZaGUI.java b/cs654/proj1/KaZaGUI.java index 3fda680..2f721e3 100644 --- a/cs654/proj1/KaZaGUI.java +++ b/cs654/proj1/KaZaGUI.java @@ -109,6 +109,7 @@ public class KaZaGUI extends JFrame speeds.add(new ConnectionSpeed("3 Mbps", 3000)); speeds.add(new ConnectionSpeed("6 Mbps", 6000)); speeds.add(new ConnectionSpeed("10 Mbps", 10000)); + speeds.add(new ConnectionSpeed("45 Mbps", 45000)); speeds.add(new ConnectionSpeed("100 Mbps", 100000)); speeds.add(new ConnectionSpeed("1 Gbps", 1000000)); speeds.add(new ConnectionSpeed("10 Gbps", 10000000)); diff --git a/cs654/proj1/KaZaServer.java b/cs654/proj1/KaZaServer.java index d5f8611..460d86f 100644 --- a/cs654/proj1/KaZaServer.java +++ b/cs654/proj1/KaZaServer.java @@ -1,9 +1,48 @@ -public class KaZaServer +import java.io.*; +import java.net.*; +import java.util.*; + +public class KaZaServer implements Runnable { public static final int LISTEN_PORT = 3442; + private ServerSocket m_serverSocket; - public KaZaServer() + public void run() + { + try { + m_serverSocket = new ServerSocket(LISTEN_PORT); + + /* porcess connection requests */ + for (;;) + { + Socket clientSocket = m_serverSocket.accept(); + + Thread thread = new Thread(new ClientHandler(clientSocket)); + thread.start(); + } + } catch (IOException ioe) { + System.out.println("IO Exception!"); + ioe.printStackTrace(); + return; + } + } + + public void close() { } + + private class ClientHandler implements Runnable + { + Socket m_socket; + + public ClientHandler(Socket socket) + { + m_socket = socket; + } + + public void run() + { + } + } }