Jetty 9及更高版本中的SelectChannelConnector替代类

编程入门 行业动态 更新时间:2024-10-27 00:32:17
本文介绍了Jetty 9及更高版本中的SelectChannelConnector替代类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Jetty 9及更高版本的SelectChannelConnector的替代类是什么?另外,SelectChannelConnector类的用途是什么?在jetty/servlet体系结构中,连接器类的用途是什么?

What is the alternative class of SelectChannelConnector for jetty 9 and above version? Also what is the use of SelectChannelConnector class? And also what is the use of connector classes in jetty/servlet architechture?

我们可以使用ServerConnector或NetworkTrafficSelectChannelConnector类(在Jetty 9.x中弃用)类代替SelectChannelConnector类吗?

Can we use ServerConnector or NetworkTrafficSelectChannelConnector (deprecated in jetty 9.x) class instead of SelectChannelConnector?

推荐答案

用码头术语表示的Connector是绑定到端口,接受传入连接,协商协议的组件(在SSL/TLS/ALPN和之类的东西,例如HTTP/2),然后将原始端点交给适当的码头内部组件来处理请求.

A Connector in jetty terms is the component that binds to a port, accepts incoming connections, negotiates the protocols (in case of SSL/TLS/ALPN and things like HTTP/2), and hands off the raw endpoint to the appropriate jetty internal component to process the request.

监听8080端口并仅在HTTP/1.x中应答的日子已经一去不复返了

Gone are the days of listening on port 8080 and answering only in HTTP/1.x

现在您可以在端口8080上侦听,并且传入的连接会协商SSL> TLS> > ALPN> HTTP/2(本机)> HTTP/1.1> HTTP/2(h2c升级)等.本质上是根据客户端和服务器都可以处理的内容来选择适当的连接设置.

Now you can listen on port 8080, and the incoming connection negotiates SSL > TLS > > ALPN > HTTP/2 (native) > HTTP/1.1 > HTTP/2 (h2c upgrate) etc. Essentially picking the appropriate connection setup based on what both the client and the server can handle.

只剩下ServerConnector,它有许多配置选项可以告诉您您希望它支持什么.

There is only ServerConnector left, and it has many configuration options to tell it what you want it to support.

请参阅嵌入式示例或文档,以了解如何进行配置.

See the embedded examples or the documentation to understand how to configure it.

更多推荐

Jetty 9及更高版本中的SelectChannelConnector替代类

本文发布于:2023-11-27 01:28:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636010.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:更高   版本   Jetty   SelectChannelConnector

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!