Package io.netty.handler.codec.sctp
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 io.netty.channel.ChannelHandler
ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate static final intprivate final IntObjectMap<List<ByteBuf>> private final intprivate final intprivate final int -
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 TypeMethodDescriptionprivate voidcheckBufferedBytes(ByteBuf byteBuf) protected 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.private voidremoveBufferedBytes(List<ByteBuf> buffers) Methods inherited from class io.netty.handler.codec.MessageToMessageDecoder
acceptInboundMessage, channelRead, channelReadCompleteMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded
-
Field Details
-
DEFAULT_MAX_BUFFERED_BYTES
private static final int DEFAULT_MAX_BUFFERED_BYTES- See Also:
-
incompleteSctpMessages
-
maxIncompleteSctpMessages
private final int maxIncompleteSctpMessages -
maxFragments
private final int maxFragments -
maxBufferedBytes
private final int maxBufferedBytes -
bufferedBytes
private long bufferedBytes
-
-
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
-
checkBufferedBytes
-
removeBufferedBytes
-
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
-