How do you set both port and thread pool using embedded jetty, v 9.1.0

后端 未结 4 2340
猫巷女王i
猫巷女王i 2021-02-20 00:09

I\'m using jetty 9.1.0, embedded, and would like to set both port and ThreadPool. I see a constructor for each, but don\'t see how to use one of those, and then any way to set t

4条回答
  •  长发绾君心
    2021-02-20 00:25

        Server server = new Server(new QueuedThreadPool(128, 8));
        ServerConnector connector = new ServerConnector(server, new HttpConnectionFactory());
    
        connector.setPort(8897);
        server.addConnector(connector);
    

提交回复
热议问题