- java.lang.Object
-
- io.netty5.channel.ChannelHandlerAdapter
-
- io.netty5.channel.CombinedChannelDuplexHandler<HttpRequestDecoder,HttpResponseEncoder>
-
- io.netty5.handler.codec.http.HttpServerCodec
-
- All Implemented Interfaces:
ChannelHandler
,HttpServerUpgradeHandler.SourceCodec
public final class HttpServerCodec extends CombinedChannelDuplexHandler<HttpRequestDecoder,HttpResponseEncoder> implements HttpServerUpgradeHandler.SourceCodec
A combination ofHttpRequestDecoder
andHttpResponseEncoder
which enables easier server side HTTP implementation.- See Also:
HttpClientCodec
-
-
Constructor Summary
Constructors Constructor Description HttpServerCodec()
Creates a new instance with the default decoder options (maxInitialLineLength (4096
},maxHeaderSize (8192)
, andmaxChunkSize (8192)
).HttpServerCodec(int maxInitialLineLength, int maxHeaderSize)
Creates a new instance with the specified decoder options.HttpServerCodec(int maxInitialLineLength, int maxHeaderSize, boolean validateHeaders)
Creates a new instance with the specified decoder options.HttpServerCodec(int maxInitialLineLength, int maxHeaderSize, boolean validateHeaders, int initialBufferSize)
Creates a new instance with the specified decoder options.HttpServerCodec(int maxInitialLineLength, int maxHeaderSize, boolean validateHeaders, int initialBufferSize, boolean allowDuplicateContentLengths)
Creates a new instance with the specified decoder options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
upgradeFrom(ChannelHandlerContext ctx)
Upgrades to another protocol from HTTP.-
Methods inherited from class io.netty5.channel.CombinedChannelDuplexHandler
bind, channelActive, channelExceptionCaught, channelInactive, channelInboundEvent, channelRead, channelReadComplete, channelRegistered, channelShutdown, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, handlerAdded, handlerRemoved, inboundHandler, init, isSharable, outboundHandler, pendingOutboundBytes, read, register, removeInboundHandler, removeOutboundHandler, sendOutboundEvent, shutdown, write
-
-
-
-
Constructor Detail
-
HttpServerCodec
public HttpServerCodec()
Creates a new instance with the default decoder options (maxInitialLineLength (4096
},maxHeaderSize (8192)
, andmaxChunkSize (8192)
).
-
HttpServerCodec
public HttpServerCodec(int maxInitialLineLength, int maxHeaderSize)
Creates a new instance with the specified decoder options.
-
HttpServerCodec
public HttpServerCodec(int maxInitialLineLength, int maxHeaderSize, boolean validateHeaders)
Creates a new instance with the specified decoder options.
-
HttpServerCodec
public HttpServerCodec(int maxInitialLineLength, int maxHeaderSize, boolean validateHeaders, int initialBufferSize)
Creates a new instance with the specified decoder options.
-
HttpServerCodec
public HttpServerCodec(int maxInitialLineLength, int maxHeaderSize, boolean validateHeaders, int initialBufferSize, boolean allowDuplicateContentLengths)
Creates a new instance with the specified decoder options.
-
-
Method Detail
-
upgradeFrom
public void upgradeFrom(ChannelHandlerContext ctx)
Upgrades to another protocol from HTTP. Removes theHttpRequestDecoder
andHttpResponseEncoder
from the pipeline.- Specified by:
upgradeFrom
in interfaceHttpServerUpgradeHandler.SourceCodec
-
-