Class MessageChunksBuffer

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

    public class MessageChunksBuffer
    extends io.netty.handler.codec.MessageToMessageDecoder<MessageChunk>
    Buffers until all MessageChunks belonging to the same message have been collected, then passes them in the correct order.
    See Also:
    ChunkedMessageInput
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • Constructor Summary

      Constructors 
      Constructor Description
      MessageChunksBuffer​(int maxContentLength, int allChunksTimeout, int maxChunks)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void decode​(io.netty.channel.ChannelHandlerContext ctx, MessageChunk msg, List<Object> out)  
      • Methods inherited from class io.netty.handler.codec.MessageToMessageDecoder

        acceptInboundMessage, channelRead
      • Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

        channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, handlerAdded, handlerRemoved, isSharable
      • Methods inherited from interface io.netty.channel.ChannelHandler

        handlerAdded, handlerRemoved
    • Constructor Detail

      • MessageChunksBuffer

        public MessageChunksBuffer​(int maxContentLength,
                                   int allChunksTimeout,
                                   int maxChunks)
        Creates a new instance.
        Parameters:
        maxContentLength - the maximum cumulative length of the aggregated message. If the length of the buffered content exceeds this value, a {@link TooLongFrameException)} will be thrown.
        allChunksTimeout - time in milliseconds after receiving the first chunk to wait for remaining chunks. Upon timeout, received chunks will be discarded. A value of 0 deactivates the timeout function.
        maxChunks - maximum number of chunks to collect. If the more chunks are required to aggregate the message, all chunks will be discarded.