Framing Methods |
The Framing type exposes the following members.
Name | Description | |
---|---|---|
Delimiter |
Creates a Flow that handles decoding a stream of unstructured byte chunks into a stream of frames where the
incoming chunk stream uses a specific byte-sequence to mark frame boundaries.
The decoded frames will not include the separator sequence.
If there are buffered bytes (an incomplete frame) when the input stream finishes and allowTruncation is set to
false then this Flow will fail the stream reporting a truncated frame.
| |
LengthField |
Creates a Flow that decodes an incoming stream of unstructured byte chunks into a stream of frames, assuming that
incoming frames have a field that encodes their length.
If the input stream finishes before the last frame has been fully decoded this Flow will fail the stream reporting
a truncated frame.
| |
SimpleFramingProtocol |
Returns a BidiFlow that implements a simple framing protocol. This is a convenience wrapper over LengthField(Int32, Int32, Int32, ByteOrder)
and simply attaches a length field header of four bytes (using big endian encoding) to outgoing messages, and decodes
such messages in the inbound direction. The decoded messages do not contain the header.
This BidiFlow is useful if a simple message framing protocol is needed (for example when TCP is used to send
individual messages) but no compatibility with existing protocols is necessary.
The encoded frames have the layout
{{{
[4 bytes length field, Big Endian][User Payload]
}}}
The length field encodes the length of the user payload excluding the header itself.
| |
SimpleFramingProtocolDecoder |
Protocol decoder that is used by SimpleFramingProtocol(Int32) | |
SimpleFramingProtocolEncoder |
Protocol encoder that is used by SimpleFramingProtocol(Int32) |