Required Instance Methodswift-nio 2.81.0NIOCore

decodeLast(context:buffer:seenEOF:)

Decode from a ByteBuffer when no more data is incoming and the ByteToMessageDecoder is about to leave the pipeline.

Codec.swift:177
mutating func decodeLast(context: ChannelHandlerContext, buffer: inout ByteBuffer, seenEOF: Bool) throws -> DecodingState

Parameters

context

The ChannelHandlerContext which this ByteToMessageDecoder belongs to.

buffer

The ByteBuffer from which we decode.

seenEOF

true if EOF has been seen. Usually if this is false the handler has been removed.

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.