WebSocketFrameDecoder
An inbound ChannelHandler
that deserializes websocket frames into a structured format for further processing.
final class WebSocketFrameDecoder
This decoder has limited enforcement of compliance to RFC 6455. In particular, to guarantee that the decoder can handle arbitrary extensions, only normative MUST/MUST NOTs that do not relate to extensions (e.g. the requirement that control frames not have lengths larger than 125 bytes) are enforced by this decoder.
This decoder does not have any support for decoding extensions. If you wish to support extensions, you should implement a message-to-message decoder that performs the appropriate frame transformation as needed. All the frame data is assumed to be application data by this parser.
Citizens in NIOWebSocket
Conformances
protocol ByteToMessageDecoder
ByteToMessageDecoder
s decode bytes in a stream-like fashion fromByteBuffer
to another message type.
Typealiases
Type members
init(maxFrameSize: Int
) Construct a new
WebSocketFrameDecoder
Instance members
Instance features
func decodeLast(context: ChannelHandlerContext, buffer: inout ByteBuffer, seenEOF: Bool
) throws -> DecodingState func decoderAdded(context: ChannelHandlerContext
) func decoderRemoved(context: ChannelHandlerContext
) func shouldReclaimBytes(buffer: ByteBuffer
) -> Bool Default implementation to detect once bytes should be reclaimed.
func wrapInboundOut(InboundOut
) -> NIOAny