public static void main(String[] args) throws IOException {
        int portNo = 9090;

        try {
            if (args.length == 1) {
                portNo = Integer.parseInt(args[0]);
            }
        } catch (Exception e) {
            System.err.println("Invalid port number!");
            System.exit(1);
        }

        ServerSocket listener = new ServerSocket(9090);
        
        StockControl.startUpdater(120000);
        
        try {
            while (true) {
                Socket socket = listener.accept();
                Thread t = new Thread(new ConnectionHandler(socket));
                t.start();
            }
        } finally {
            listener.close();
        }
    }