package mug13; /* * This file starts the server running. * * @author Brett McMillian * @author Louisa Poythress * */ import java.net.*; import java.io.*; import java.util.*; public class Server { public static void main(String[] args) throws IOException, ClassNotFoundException, FileNotFoundException { ServerSocket serverSocket = null; try { //Open specs.txt FileReader fr = new FileReader("specs.txt"); //Create a BufferedReader to read from specs.txt BufferedReader br = new BufferedReader(fr); //Skip over "Port: " br.skip(6); //Read the port number Integer intPort = new Integer(br.readLine()); // Convert the port number to an integer; int port = intPort.intValue(); //Create a ServerSocket serverSocket = new ServerSocket(port); //Start the MainServerThread new MainServerThread(serverSocket).start(); } catch (IOException e) { System.err.println("Could not listen on port."); System.exit(1); } } //main }