public class HAProxyMessageDecoder extends ByteToMessageDecoder
ByteToMessageDecoder.Cumulator
ChannelHandler.Sharable, ChannelHandler.Skip
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
Constructor and Description |
---|
HAProxyMessageDecoder()
Creates a new decoder with no additional data (TLV) restrictions
|
HAProxyMessageDecoder(int maxTlvSize)
Creates a new decoder with restricted additional data (TLV) size
Note: limiting TLV size only affects processing of v2, binary headers.
|
Modifier and Type | Method and Description |
---|---|
void |
channelRead(ChannelHandlerContext ctx,
Object msg)
Calls
ChannelHandlerContext.fireChannelRead(Object) to forward
to the next ChannelHandler in the ChannelPipeline . |
protected void |
decode(ChannelHandlerContext ctx,
ByteBuf in,
List<Object> out)
Decode the from one
ByteBuf to an other. |
boolean |
isSingleDecode()
If
true then only one message is decoded on each
ByteToMessageDecoder.channelRead(ChannelHandlerContext, Object) call. |
actualReadableBytes, callDecode, channelInactive, channelReadComplete, decodeLast, handlerRemoved, handlerRemoved0, internalBuffer, setCumulator, setSingleDecode
bind, channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, exceptionCaught, flush, handlerAdded, isSharable, read, userEventTriggered, write
public HAProxyMessageDecoder()
public HAProxyMessageDecoder(int maxTlvSize)
Note: limiting TLV size only affects processing of v2, binary headers. Also, as allowed by the 1.5 spec
TLV data is currently ignored. For maximum performance it would be best to configure your upstream proxy host to
NOT send TLV data and instantiate with a max TLV size of 0
.
maxTlvSize
- maximum number of bytes allowed for additional data (Type-Length-Value vectors) in a v2 headerpublic boolean isSingleDecode()
ByteToMessageDecoder
true
then only one message is decoded on each
ByteToMessageDecoder.channelRead(ChannelHandlerContext, Object)
call.
Default is false
as this has performance impacts.isSingleDecode
in class ByteToMessageDecoder
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
ChannelHandlerAdapter
ChannelHandlerContext.fireChannelRead(Object)
to forward
to the next ChannelHandler
in the ChannelPipeline
.
Sub-classes may override this method to change behavior.channelRead
in interface ChannelHandler
channelRead
in class ByteToMessageDecoder
Exception
protected final void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception
ByteToMessageDecoder
ByteBuf
to an other. This method will be called till either the input
ByteBuf
has nothing to read when return from this method or till nothing was read from the input
ByteBuf
.decode
in class ByteToMessageDecoder
ctx
- the ChannelHandlerContext
which this ByteToMessageDecoder
belongs toin
- the ByteBuf
from which to read dataout
- the List
to which decoded messages should be addedException
- is thrown if an error accourCopyright © 2008–2015 The Netty Project. All rights reserved.