public final class HttpServerCodec extends CombinedChannelDuplexHandler<HttpRequestDecoder,HttpResponseEncoder> implements HttpServerUpgradeHandler.SourceCodec
HttpRequestDecoder
和HttpResponseEncoder
的组合使服务器端HTTP实现更简单。
HttpClientCodec
ChannelHandler.Sharable
Constructor and Description |
---|
HttpServerCodec()
使用默认解码器选项(
maxInitialLineLength (4096 },
maxHeaderSize (8192) 和
maxChunkSize (8192) )创建一个新实例。
|
HttpServerCodec(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize)
用指定的解码器选项创建一个新实例。
|
HttpServerCodec(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders)
用指定的解码器选项创建一个新实例。
|
HttpServerCodec(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders, int initialBufferSize)
用指定的解码器选项创建一个新实例。
|
Modifier and Type | Method and Description |
---|---|
void |
upgradeFrom(ChannelHandlerContext ctx)
从HTTP升级到另一个协议。
|
bind, channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, exceptionCaught, flush, handlerAdded, handlerRemoved, inboundHandler, init, outboundHandler, read, removeInboundHandler, removeOutboundHandler, userEventTriggered, write
ensureNotSharable, isSharable
public HttpServerCodec()
maxInitialLineLength (4096
},
maxHeaderSize (8192)
和
maxChunkSize (8192)
)。
public HttpServerCodec(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize)
public HttpServerCodec(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders)
public HttpServerCodec(int maxInitialLineLength, int maxHeaderSize, int maxChunkSize, boolean validateHeaders, int initialBufferSize)
public void upgradeFrom(ChannelHandlerContext ctx)
HttpRequestDecoder
和HttpResponseEncoder
。
upgradeFrom
接口
HttpServerUpgradeHandler.SourceCodec
Copyright © 2008–2018 The Netty Project. All rights reserved.