MessageToByteHandler

    A handler which turns a given MessageToByteEncoder into a ChannelOutboundHandler that can then be added to a ChannelPipeline.

    Codec.swift:773
    final class MessageToByteHandler<Encoder> where Encoder : MessageToByteEncoder

    See also

    • protocol ByteToMessageDecoder

      ByteToMessageDecoders decode bytes in a stream-like fashion from ByteBuffer to another message type.

    • protocol WriteObservingByteToMessageDecoder

      Some ByteToMessageDecoders need to observe writes (which are outbound events). ByteToMessageDecoders which implement the WriteObservingByteToMessageDecoder protocol will be notified about every outbound write.

    • enum DecodingState

      State of the current decoding process.

    • class ByteToMessageHandler<Decoder>

      A handler which turns a given ByteToMessageDecoder into a ChannelInboundHandler that can then be added to a ChannelPipeline.

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

    • class NIOSingleStepByteToMessageProcessor<Decoder>

      NIOSingleStepByteToMessageProcessor uses a NIOSingleStepByteToMessageDecoder to produce messages from a stream of incoming bytes. It works like ByteToMessageHandler but may be used outside of the channel pipeline. This allows processing of wrapped protocols in a general way.

    • protocol MessageToByteEncoder

      A protocol for straightforward encoders which encode custom messages to ByteBuffers. To add a MessageToByteEncoder to a ChannelPipeline, use channel.pipeline.addHandler(MessageToByteHandler(myEncoder).

    Citizens in NIOCore

    Conformances

    Show implementation details (2)

    Hide implementation details

    Typealiases

    Type members

    Instance features

    Citizens in NIOCore

    where Encoder:MessageToByteEncoder

    Instance members