server accepting connections
git-svn-id: svn://anubis/gvsu@29 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
c8a2a18afb
commit
c84d3e4b0b
@ -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));
|
||||
|
@ -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()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user