JETTY Non-blocking By default?

Please tell me,
is Jetty non-blocking web server by default?

For example, the following code runs Jetty as a non-blocking web server?

Server server = new Server(8080);

ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);

context.setContextPath("/");

server.setHandler(context);

context.addServlet(new ServletHolder(new MyServlet()),"/*") ;

server.start();

server.join();

Thank you! ! !

It depends on the version of Jetty you are using.

> In Jetty 6, the “Server(int port)” constructor will open a blocking connector on the port.
>In Jetty 7, the “Server(int port)” constructor will open a non-blocking connector on the port Connector.

If you really care about this behavior, you’d better configure the connector yourself instead of relying on the convenience constructor.

Please tell me,
is Jetty non-blocking web server by default?

For example, the following code runs Jetty as a non-blocking web server?

Server server = new Server(8080);

ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);

context.setContextPath("/");

server.setHandler(context);

context.addServlet(new ServletHolder(new MyServlet()),"/*") ;

server.start();

server.join();

Thank you! ! !

It depends on the Jetty version you are using.

>In Jetty 6, “Server(int port)” The constructor will open a blocking connector on this port.
>In Jetty 7, the “Server(int port)” constructor opens a non-blocking connector on this port.

If you If you really care about this behavior, you’d better configure the connector yourself instead of relying on the convenience constructor.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4576 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.