package de.dwerth.gntpserver.run;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import de.dwerth.gntpserver.gntp.InputThread;
public class MainServer {
public final static int PORT = 23054;
public static void main(String[] args) {
ServerSocket server = null;
try {
server = new ServerSocket(PORT);
// wait for Connections
System.out.println("server fully up and running");
while (true) {
Socket s = server.accept();
System.out.println("new connection from " + s.getInetAddress());
InputThread ct = new InputThread(s);
ct.start();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (server != null) {
try {
server.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}