public static void main(String args[]) {
		int port;
		if (args.length != 1) {
			printUsage();
			return;
		}
		try {
			// parse the port number from input argument
			port = Integer.parseInt(args[0]);
		} catch (NumberFormatException e) {
			printUsage();
			return;
		}

		// instantiate a new registry server object
		RegistryServer regServer = new RegistryServer(port);
		// registry start to listen to input connections
		// the incoming messages should only be the following types
		// from client: lookup
		// from service server: bind, unbind, rebind
		while (true) {
			try {
				Socket socket = regServer.serverSocket.accept();
				new Thread(new RegistryWorker(socket, regServer)).start();
			} catch (IOException e) {
				System.out.println(e.getMessage());
			}
		}
	}