Class SctpMessageCompletionHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.MessageToMessageDecoder<SctpMessage>
io.netty.handler.codec.sctp.SctpMessageCompletionHandler
- All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler
MessageToMessageDecoder which will take care of handle fragmented SctpMessages, so
only complete SctpMessages will be forwarded to the next
ChannelInboundHandler.-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.SharableModifier and TypeInterfaceDescriptionstatic @interfaceIndicates that the same instance of the annotatedChannelHandlercan be added to one or moreChannelPipelines multiple times without a race condition. -
Constructor Summary
ConstructorsConstructorDescriptionSctpMessageCompletionHandler(int maxIncompleteSctpMessages, int maxFragments) Create a new instance.SctpMessageCompletionHandler(int maxIncompleteSctpMessages, int maxFragments, int maxBufferedBytes) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddecode(ChannelHandlerContext ctx, SctpMessage msg, List<Object> out) Decode from one message to an other.voidexceptionCaught(ChannelHandlerContext ctx, Throwable cause) CallsChannelHandlerContext.fireExceptionCaught(Throwable)to forward to the nextChannelHandlerin theChannelPipeline.voidDo nothing by default, sub-classes may override this method.Methods inherited from class MessageToMessageDecoder
acceptInboundMessage, channelRead, channelReadCompleteModifier and TypeMethodDescriptionbooleanReturnstrueif the given message should be handled.voidchannelRead(ChannelHandlerContext ctx, Object msg) CallsChannelHandlerContext.fireChannelRead(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelReadComplete()to forward to the nextChannelInboundHandlerin theChannelPipeline.Methods inherited from class ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredModifier and TypeMethodDescriptionvoidCallsChannelHandlerContext.fireChannelActive()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelInactive()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelRegistered()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelUnregistered()to forward to the nextChannelInboundHandlerin theChannelPipeline.voidCallsChannelHandlerContext.fireChannelWritabilityChanged()to forward to the nextChannelInboundHandlerin theChannelPipeline.voiduserEventTriggered(ChannelHandlerContext ctx, Object evt) CallsChannelHandlerContext.fireUserEventTriggered(Object)to forward to the nextChannelInboundHandlerin theChannelPipeline.Methods inherited from class ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharableModifier and TypeMethodDescriptionprotected voidvoidDo nothing by default, sub-classes may override this method.booleanReturntrueif the implementation isChannelHandler.Sharableand so can be added to differentChannelPipelines.
-
Constructor Details
-
SctpMessageCompletionHandler
public SctpMessageCompletionHandler() -
SctpMessageCompletionHandler
public SctpMessageCompletionHandler(int maxIncompleteSctpMessages, int maxFragments) Create a new instance.- Parameters:
maxIncompleteSctpMessages- the maximum number of incomplete sctp message inflight.maxFragments- the maximum number of fragments per sctp message.
-
SctpMessageCompletionHandler
public SctpMessageCompletionHandler(int maxIncompleteSctpMessages, int maxFragments, int maxBufferedBytes) Create a new instance.- Parameters:
maxIncompleteSctpMessages- the maximum number of incomplete sctp message inflight.maxFragments- the maximum number of fragments per sctp message.maxBufferedBytes- the maximum number of bytes buffered by incomplete sctp messages.
-
-
Method Details
-
decode
protected void decode(ChannelHandlerContext ctx, SctpMessage msg, List<Object> out) throws Exception Description copied from class:MessageToMessageDecoderDecode from one message to an other. This method will be called for each written message that can be handled by this decoder.- Specified by:
decodein classMessageToMessageDecoder<SctpMessage>- Parameters:
ctx- theChannelHandlerContextwhich thisMessageToMessageDecoderbelongs tomsg- the message to decode to an other oneout- theListto which decoded messages should be added- Throws:
Exception- is thrown if an error occurs
-
handlerRemoved
Description copied from class:ChannelHandlerAdapterDo nothing by default, sub-classes may override this method.- Specified by:
handlerRemovedin interfaceChannelHandler- Overrides:
handlerRemovedin classChannelHandlerAdapter- Throws:
Exception
-
exceptionCaught
Description copied from class:ChannelInboundHandlerAdapterCallsChannelHandlerContext.fireExceptionCaught(Throwable)to forward to the nextChannelHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
exceptionCaughtin interfaceChannelHandler- Specified by:
exceptionCaughtin interfaceChannelInboundHandler- Overrides:
exceptionCaughtin classChannelInboundHandlerAdapter- Throws:
Exception
-