@UnstableApi public class Http2ClientUpgradeCodec extends java.lang.Object implements HttpClientUpgradeHandler.UpgradeCodec
| 构造器和说明 |
|---|
Http2ClientUpgradeCodec(Http2ConnectionHandler connectionHandler)
Creates the codec using a default name for the connection handler when adding to the
pipeline.
|
Http2ClientUpgradeCodec(Http2ConnectionHandler connectionHandler,
Http2MultiplexHandler http2MultiplexHandler)
Creates the codec using a default name for the connection handler when adding to the
pipeline.
|
Http2ClientUpgradeCodec(Http2FrameCodec frameCodec,
ChannelHandler upgradeToHandler) |
Http2ClientUpgradeCodec(java.lang.String handlerName,
Http2ConnectionHandler connectionHandler)
Creates the codec providing an upgrade to the given handler for HTTP/2.
|
Http2ClientUpgradeCodec(java.lang.String handlerName,
Http2ConnectionHandler connectionHandler,
Http2MultiplexHandler http2MultiplexHandler)
Creates the codec providing an upgrade to the given handler for HTTP/2.
|
Http2ClientUpgradeCodec(java.lang.String handlerName,
Http2FrameCodec frameCodec,
ChannelHandler upgradeToHandler) |
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.CharSequence |
protocol()
Returns the name of the protocol supported by this codec, as indicated by the
'UPGRADE' header. |
java.util.Collection<java.lang.CharSequence> |
setUpgradeHeaders(ChannelHandlerContext ctx,
HttpRequest upgradeRequest)
Sets any protocol-specific headers required to the upgrade request.
|
void |
upgradeTo(ChannelHandlerContext ctx,
FullHttpResponse upgradeResponse)
Performs an HTTP protocol upgrade from the source codec.
|
public Http2ClientUpgradeCodec(Http2FrameCodec frameCodec, ChannelHandler upgradeToHandler)
public Http2ClientUpgradeCodec(java.lang.String handlerName,
Http2FrameCodec frameCodec,
ChannelHandler upgradeToHandler)
public Http2ClientUpgradeCodec(Http2ConnectionHandler connectionHandler)
connectionHandler - the HTTP/2 connection handlerpublic Http2ClientUpgradeCodec(Http2ConnectionHandler connectionHandler, Http2MultiplexHandler http2MultiplexHandler)
connectionHandler - the HTTP/2 connection handlerhttp2MultiplexHandler - the Http2 Multiplexer handler to work with Http2FrameCodecpublic Http2ClientUpgradeCodec(java.lang.String handlerName,
Http2ConnectionHandler connectionHandler)
handlerName - the name of the HTTP/2 connection handler to be used in the pipeline,
or null to auto-generate the nameconnectionHandler - the HTTP/2 connection handlerpublic Http2ClientUpgradeCodec(java.lang.String handlerName,
Http2ConnectionHandler connectionHandler,
Http2MultiplexHandler http2MultiplexHandler)
handlerName - the name of the HTTP/2 connection handler to be used in the pipeline,
or null to auto-generate the nameconnectionHandler - the HTTP/2 connection handlerpublic java.lang.CharSequence protocol()
HttpClientUpgradeHandler.UpgradeCodec'UPGRADE' header.public java.util.Collection<java.lang.CharSequence> setUpgradeHeaders(ChannelHandlerContext ctx, HttpRequest upgradeRequest)
HttpClientUpgradeHandler.UpgradeCodecpublic void upgradeTo(ChannelHandlerContext ctx, FullHttpResponse upgradeResponse) throws java.lang.Exception
HttpClientUpgradeHandler.UpgradeCodecupgradeTo 在接口中 HttpClientUpgradeHandler.UpgradeCodecctx - the context for the current handler.upgradeResponse - the 101 Switching Protocols response that indicates that the server
has switched to this protocol.java.lang.Exception