public class HttpServerUpgradeHandler extends HttpObjectAggregator
Modifier and Type | Class and Description |
---|---|
static interface |
HttpServerUpgradeHandler.SourceCodec
最初在流水线中使用的源代码编解码器。
|
static interface |
HttpServerUpgradeHandler.UpgradeCodec
源可以升级到的编解码器。
|
static interface |
HttpServerUpgradeHandler.UpgradeCodecFactory
为请求的协议名称创建一个新的 HttpServerUpgradeHandler.UpgradeCodec 。
|
static class |
HttpServerUpgradeHandler.UpgradeEvent
用户事件被触发以通知HTTP升级到另一协议的完成。
|
ChannelHandler.Sharable
Constructor and Description |
---|
HttpServerUpgradeHandler(HttpServerUpgradeHandler.SourceCodec sourceCodec, HttpServerUpgradeHandler.UpgradeCodecFactory upgradeCodecFactory)
用支持的编解码器构建升级程序。
|
HttpServerUpgradeHandler(HttpServerUpgradeHandler.SourceCodec sourceCodec, HttpServerUpgradeHandler.UpgradeCodecFactory upgradeCodecFactory, int maxContentLength)
用支持的编解码器构建升级程序。
|
Modifier and Type | Method and Description |
---|---|
protected void |
decode(ChannelHandlerContext ctx, HttpObject msg, java.util.List<java.lang.Object> out)
从一条消息解码到另一条消息。
|
aggregate, beginAggregation, closeAfterContinueResponse, finishAggregation, handleOversizedMessage, ignoreContentAfterContinueResponse, isAggregated, isContentLengthInvalid, isContentMessage, isLastContentMessage, isStartMessage, newContinueResponse
acceptInboundMessage, channelInactive, channelReadComplete, ctx, handlerAdded, handlerRemoved, isHandlingOversizedMessage, maxContentLength, maxCumulationBufferComponents, setMaxCumulationBufferComponents
channelRead
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, isSharable
public HttpServerUpgradeHandler(HttpServerUpgradeHandler.SourceCodec sourceCodec, HttpServerUpgradeHandler.UpgradeCodecFactory upgradeCodecFactory)
由此构造函数实例化的处理程序将拒绝具有非空内容的升级请求。 不应该担心,因为升级请求很可能是GET请求。 如果您有发送非GET升级请求的客户端,请考虑使用HttpServerUpgradeHandler(SourceCodec, UpgradeCodecFactory, int)
指定升级请求内容的最大长度。
sourceCodec
- 最初使用的编解码器
upgradeCodecFactory
- 为请求的升级协议之一创建新升级编解码器的工厂
public HttpServerUpgradeHandler(HttpServerUpgradeHandler.SourceCodec sourceCodec, HttpServerUpgradeHandler.UpgradeCodecFactory upgradeCodecFactory, int maxContentLength)
sourceCodec
- 最初使用的编解码器
upgradeCodecFactory
- 为请求的升级协议之一创建新升级编解码器的工厂
maxContentLength
- 升级请求内容的最大长度
protected void decode(ChannelHandlerContext ctx, HttpObject msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
MessageToMessageDecoder
decode
在课堂
MessageAggregator<HttpObject,HttpMessage,HttpContent,FullHttpMessage>
ctx
- 这MessageToMessageDecoder
属于的ChannelHandlerContext
msg
- 解码到另一个的消息
out
- 应该添加解码消息的
List
java.lang.Exception
- 发生错误时抛出
Copyright © 2008–2018 The Netty Project. All rights reserved.