package pad.prac2; import java.util.Scanner; public class JChat { public static void main(String[] args) { String ip; int port, roomSize; Scanner in = new Scanner(System.in); System.out.print("IP: "); ip = in.nextLine(); System.out.print("Port: "); port = in.nextInt(); System.out.print("Size of chatroom: "); roomSize = in.nextInt(); in.close(); final Server serv = new Server(ip,port,roomSize); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { System.out.println("JChat: Caught interrupt, killing server..."); serv.killServer(); } }); serv.startServer(); } }