@UnstableApi public class Http2ClientUpgradeCodec extends java.lang.Object implements HttpClientUpgradeHandler.UpgradeCodec
Constructor and Description |
---|
Http2ClientUpgradeCodec(Http2ConnectionHandler connectionHandler)
添加到管道时,使用连接处理程序的默认名称创建编解码器。
|
Http2ClientUpgradeCodec(Http2FrameCodec frameCodec, ChannelHandler upgradeToHandler) |
Http2ClientUpgradeCodec(java.lang.String handlerName, Http2ConnectionHandler connectionHandler)
创建提供HTTP / 2给定处理程序升级的编解码器。
|
Http2ClientUpgradeCodec(java.lang.String handlerName, Http2FrameCodec frameCodec, ChannelHandler upgradeToHandler) |
Modifier and Type | Method and Description |
---|---|
java.lang.CharSequence |
protocol()
返回此编解码器支持的协议的名称,如
'UPGRADE' 标头所示。
|
java.util.Collection<java.lang.CharSequence> |
setUpgradeHeaders(ChannelHandlerContext ctx, HttpRequest upgradeRequest)
设置升级请求所需的任何协议专用标头。
|
void |
upgradeTo(ChannelHandlerContext ctx, FullHttpResponse upgradeResponse)
从源代码编解码器执行HTTP协议升级。
|
public Http2ClientUpgradeCodec(Http2FrameCodec frameCodec, ChannelHandler upgradeToHandler)
public Http2ClientUpgradeCodec(java.lang.String handlerName, Http2FrameCodec frameCodec, ChannelHandler upgradeToHandler)
public Http2ClientUpgradeCodec(Http2ConnectionHandler connectionHandler)
connectionHandler
- HTTP / 2连接处理程序
public Http2ClientUpgradeCodec(java.lang.String handlerName, Http2ConnectionHandler connectionHandler)
handlerName
- 管道中要使用的HTTP / 2连接处理程序的名称,或者
null
自动生成名称
connectionHandler
- HTTP / 2连接处理程序
public java.lang.CharSequence protocol()
HttpClientUpgradeHandler.UpgradeCodec
'UPGRADE'
标头所示。
protocol
,界面
HttpClientUpgradeHandler.UpgradeCodec
public java.util.Collection<java.lang.CharSequence> setUpgradeHeaders(ChannelHandlerContext ctx, HttpRequest upgradeRequest)
HttpClientUpgradeHandler.UpgradeCodec
setUpgradeHeaders
接口
HttpClientUpgradeHandler.UpgradeCodec
public void upgradeTo(ChannelHandlerContext ctx, FullHttpResponse upgradeResponse) throws java.lang.Exception
HttpClientUpgradeHandler.UpgradeCodec
upgradeTo
接口
HttpClientUpgradeHandler.UpgradeCodec
ctx
- 当前处理程序的上下文。
upgradeResponse
- 101交换协议响应,表明服务器已切换到此协议。
java.lang.Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.