public static void main(String[] args) {
		
		if (args.length != 1) {
			System.err.println("usage: java Registrar [integer]");
			System.exit(1);
		}
		
		int n = Integer.parseInt(args[0]);

		Registrar server = new Registrar(n);
		Utils.out(server.pid, String.format("Registrar started; n = %d.",n));
		ServerSocket serversocket = null;
		boolean done = false;
		try {
			serversocket = new ServerSocket(Utils.REGISTRAR_PORT, n);
		
		} catch (IOException e) {
			System.err.println("Error: failure to launch registrar.");
			System.err.println(e.getMessage());
			System.exit(1);
		}
		
		while (! done) {	
			Socket clientsocket = null;
			try {
				clientsocket = serversocket.accept();
			
			} catch (IOException e) {
				System.err.println("Error: failure to accept connection at Registrar.");
				System.err.println(e.getMessage());
				System.exit(1);
			}
			/* And so it begins... */
			server.handle(clientsocket);
		}
	}