You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
787 B
30 lines
787 B
import java.net.*;
|
|
import java.io.*;
|
|
|
|
public class CtServer {
|
|
|
|
public static void main(String[] args) throws IOException{
|
|
SocketMaps.initMaps();
|
|
try{
|
|
new Console().consoleListner();
|
|
}
|
|
catch (IOException ignored){}
|
|
int port = 80;
|
|
Console.out("Socket Port", port+"");
|
|
ServerSocket instance = new ServerSocket(port);
|
|
try {
|
|
Console.out("Server", "Waiting for a Client");
|
|
while(true) {
|
|
Socket socket = instance.accept();
|
|
try {
|
|
new Client().initSocket(socket);
|
|
} catch (IOException e) {
|
|
socket.close();
|
|
}
|
|
}
|
|
} finally {
|
|
instance.close();
|
|
}
|
|
}
|
|
|
|
}
|