ProtocolNIOCore

    NIOSingleStepByteToMessageDecoder

    A simplified version of ByteToMessageDecoder that can generate zero or one messages for each invocation of decode or decodeLast. Having decode and decodeLast return an optional message avoids re-entrancy problems, since the functions relinquish exclusive access to the ByteBuffer when returning. This allows for greatly simplified processing.

    protocol NIOSingleStepByteToMessageDecoder : ByteToMessageDecoder

    Overview

    Many ByteToMessageDecoder’s can trivially be translated to NIOSingleStepByteToMessageDecoder’s. You should not implement ByteToMessageDecoder’s decode and decodeLast methods.

    Requirements

    Associated Types

    • 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.

    Instance Methods