Instance Method
decodeLast(context:buffer:seenEOF:)
ByteBuffer when no more data is incoming and the ByteToMessageDecoder is about to leave the pipeline.func decodeLast(context: ChannelHandlerContext, buffer: inout ByteBuffer, seenEOF: Bool) throws -> DecodingState
Parameters
contextThe
ChannelHandlerContextwhich thisByteToMessageDecoderbelongs to.bufferThe
ByteBufferfrom which we decode.seenEOFtrueif EOF has been seen. Usually if this isfalsethe handler has been removed.
Return Value
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.
Discussion
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.