WebSocketFrameDecoder class final

Splits a byte stream from a client into frames.

Checks what RFC 6455 lets a server check at the frame level: reserved bits, opcodes, the mask, control frame size and fragmentation. Payloads come out unmasked. A violation ends the stream with a WebSocketProtocolException.

Message assembly and the UTF-8 check happen one level up, in WebSocketMessageAssembler, so a ping in the middle of a fragmented message gets its answer without waiting for the message.

Inheritance

Constructors

WebSocketFrameDecoder({int? maxFrameSize})
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
maxFrameSize → int?
The payload size over which a frame is refused with 1009.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

bind(Stream<Uint8List> stream) → Stream<WebSocketFrame>
Transforms the provided stream.
override
cast<RS, RT>() → StreamTransformer<RS, RT>
Provides a StreamTransformer<RS, RT> view of this stream transformer.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited