Class WebSocketFrameAggregator
- java.lang.Object
-
- io.netty5.channel.ChannelHandlerAdapter
-
- io.netty5.handler.codec.MessageToMessageDecoder<I>
-
- io.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
- io.netty5.handler.codec.http.websocketx.WebSocketFrameAggregator
-
- All Implemented Interfaces:
io.netty5.channel.ChannelHandler
public class WebSocketFrameAggregator extends io.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
Handler that aggregate fragmented WebSocketFrame's. Be aware if PING/PONG/CLOSE frames are send in the middle of a fragmentedWebSocketFramethey will just get forwarded to the next handler in the pipeline.
-
-
Constructor Summary
Constructors Constructor Description WebSocketFrameAggregator(int maxContentLength)Creates a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaggregate(io.netty5.buffer.api.BufferAllocator allocator, WebSocketFrame aggregated, ContinuationWebSocketFrame content)protected WebSocketFramebeginAggregation(io.netty5.buffer.api.BufferAllocator allocator, WebSocketFrame start)protected booleancloseAfterContinueResponse(Object msg)protected booleanignoreContentAfterContinueResponse(Object msg)protected booleanisAggregated(Object msg)protected booleanisContentLengthInvalid(WebSocketFrame start, int maxContentLength)protected booleanisLastContentMessage(ContinuationWebSocketFrame msg)protected intlengthForAggregation(WebSocketFrame msg)protected intlengthForContent(ContinuationWebSocketFrame msg)protected ObjectnewContinueResponse(WebSocketFrame start, int maxContentLength, io.netty5.channel.ChannelPipeline pipeline)protected ContinuationWebSocketFrametryContentMessage(Object msg)protected WebSocketFrametryStartMessage(Object msg)-
Methods inherited from class io.netty5.handler.codec.MessageAggregatorNew
acceptInboundMessage, channelInactive, channelReadComplete, ctx, decode, finishAggregation, handleOversizedMessage, handlerAdded, handlerRemoved, maxContentLength
-
-
-
-
Method Detail
-
tryStartMessage
protected WebSocketFrame tryStartMessage(Object msg)
- Specified by:
tryStartMessagein classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
tryContentMessage
protected ContinuationWebSocketFrame tryContentMessage(Object msg)
- Specified by:
tryContentMessagein classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
isLastContentMessage
protected boolean isLastContentMessage(ContinuationWebSocketFrame msg)
- Specified by:
isLastContentMessagein classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
isAggregated
protected boolean isAggregated(Object msg) throws Exception
- Specified by:
isAggregatedin classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>- Throws:
Exception
-
isContentLengthInvalid
protected boolean isContentLengthInvalid(WebSocketFrame start, int maxContentLength)
- Specified by:
isContentLengthInvalidin classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
newContinueResponse
protected Object newContinueResponse(WebSocketFrame start, int maxContentLength, io.netty5.channel.ChannelPipeline pipeline)
- Specified by:
newContinueResponsein classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
closeAfterContinueResponse
protected boolean closeAfterContinueResponse(Object msg) throws Exception
- Specified by:
closeAfterContinueResponsein classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>- Throws:
Exception
-
ignoreContentAfterContinueResponse
protected boolean ignoreContentAfterContinueResponse(Object msg) throws Exception
- Specified by:
ignoreContentAfterContinueResponsein classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>- Throws:
Exception
-
lengthForContent
protected int lengthForContent(ContinuationWebSocketFrame msg)
- Specified by:
lengthForContentin classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
lengthForAggregation
protected int lengthForAggregation(WebSocketFrame msg)
- Specified by:
lengthForAggregationin classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
beginAggregation
protected WebSocketFrame beginAggregation(io.netty5.buffer.api.BufferAllocator allocator, WebSocketFrame start)
- Specified by:
beginAggregationin classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>
-
aggregate
protected void aggregate(io.netty5.buffer.api.BufferAllocator allocator, WebSocketFrame aggregated, ContinuationWebSocketFrame content) throws Exception- Specified by:
aggregatein classio.netty5.handler.codec.MessageAggregatorNew<WebSocketFrame,WebSocketFrame,ContinuationWebSocketFrame,WebSocketFrame>- Throws:
Exception
-
-