Class MessageChunksBuffer

All Implemented Interfaces:,

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:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface
  • Constructor Summary

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

    Modifier and Type
    protected void
    decode( ctx, MessageChunk msg, List<Object> out)

    Methods inherited from class io.netty.handler.codec.MessageToMessageDecoder

    acceptInboundMessage, channelRead

    Methods inherited from class

    channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered

    Methods inherited from class

    ensureNotSharable, handlerAdded, handlerRemoved, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface

    handlerAdded, handlerRemoved
  • Constructor Details

    • MessageChunksBuffer

      public MessageChunksBuffer(int maxContentLength, int allChunksTimeout, int maxChunks)
      Creates a new instance.
      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.
  • Method Details