decodeLast(context:buffer:seenEOF:)
Decode from a ByteBuffer
when no more data is incoming and the ByteToMessageDecoder
is about to leave the pipeline.
mutating func decodeLast(context: ChannelHandlerContext, buffer: inout ByteBuffer, seenEOF: Bool) throws -> DecodingState
Parameters
Returns
DecodingState.continue
if we should continue calling this method or DecodingState.needMoreData
if it should be called again when more data is present in the ByteBuffer
.
This method is called in a loop only once, when the ChannelHandlerContext
goes inactive (i.e. when channelInactive
is fired or the ByteToMessageDecoder
is removed from the pipeline).
Like with decode
, this method will be called in a loop until either DecodingState.needMoreData
is returned from the method or until the input ByteBuffer
has no more readable bytes. If DecodingState.continue
is returned and the ByteBuffer
contains more readable bytes, this method will immediately be invoked again.