InboundOut
The type of the messages this ByteToMessageDecoder
decodes to.
associatedtype InboundOut
The type of the messages this ByteToMessageDecoder
decodes to.
associatedtype InboundOut
import NIOCore
The core abstractions that make up SwiftNIO.
protocol ByteToMessageDecoder
ByteToMessageDecoder
s decode bytes in a stream-like fashion from ByteBuffer
to another message type.
mutating func decode(context: ChannelHandlerContext, buffer: inout ByteBuffer) throws -> DecodingState
Decode from a ByteBuffer
.
mutating func decodeLast(context: ChannelHandlerContext, buffer: inout ByteBuffer, seenEOF: Bool) throws -> DecodingState
Decode from a ByteBuffer
when no more data is incoming and the ByteToMessageDecoder
is about to leave the pipeline.
mutating func decoderAdded(context: ChannelHandlerContext)
Called when this ByteToMessageDecoder
is added to the ChannelPipeline
.
mutating func decoderRemoved(context: ChannelHandlerContext)
Called once this ByteToMessageDecoder
is removed from the ChannelPipeline
.
mutating func shouldReclaimBytes(buffer: ByteBuffer) -> Bool
Determine if the read bytes in the given ByteBuffer
should be reclaimed and their associated memory freed. Be aware that reclaiming memory may involve memory copies and so is not free.
associatedtype InboundOut
The decoded type this NIOSingleStepByteToMessageDecoder
decodes to. To conform to ByteToMessageDecoder
it must be called InboundOut
- see https://bugs.swift.org/browse/SR-11868.