Class WebSocketFrameAggregator

  • All Implemented Interfaces:
    ChannelHandler, ChannelUpstreamHandler

    public class WebSocketFrameAggregator
    extends OneToOneDecoder
    Handler that aggregate fragmented WebSocketFrame's. Be aware if PING/PONG/CLOSE frames are send in the middle of a fragmented WebSocketFrame they will just get forwarded to the next handler in the pipeline.
    • Field Detail

      • maxFrameSize

        private final int maxFrameSize
      • tooLongFrameFound

        private boolean tooLongFrameFound
    • Constructor Detail

      • WebSocketFrameAggregator

        public WebSocketFrameAggregator​(int maxFrameSize)
        Construct a new instance
        Parameters:
        maxFrameSize - If the size of the aggregated frame exceeds this value, a TooLongFrameException is thrown.
    • Method Detail

      • decode

        protected java.lang.Object decode​(ChannelHandlerContext ctx,
                                          Channel channel,
                                          java.lang.Object message)
                                   throws java.lang.Exception
        Description copied from class: OneToOneDecoder
        Transforms the specified received message into another message and return the transformed message. Return null if the received message is supposed to be discarded.
        Specified by:
        decode in class OneToOneDecoder
        Throws:
        java.lang.Exception